[PATCH v2 4/7] rust: sync: make doctests compilable/testable