Skip to content

Documentation of Send/Sync is incomplete/outdated (also in UnsafeCell) #22572

@RalfJung

Description

@RalfJung

The documentation for Sync says

Users writing their own types with interior mutability (or anything else that is not thread-safe) should use the NoSync marker type (from std::marker) to ensure that the compiler doesn't consider the user-defined type to be Sync.

However, there is no NoSync type anymore.

Send has virtually no documentation.

UnsafeCell says

UnsafeCell doesn't opt-out from any marker traits, instead, types with an UnsafeCell interior are expected to opt-out from those traits themselves.

which, if I am informed correctly, is not true anymore - Send/Sync are removed automatically for anything containing an UnsafeCell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions