Skip to content

Issues with UnsafeCells #694

Closed
Closed
@joshlf

Description

@joshlf

See also: #251

TODO: Discuss the following:

  • The fact that there's no way to "disable" interior mutability under stacked borrows, but there is under tree borrows
  • Why NoCell for MaybeUninit<T> requires T: NoCell (it's the only way to ban cells today)
    • Under certain memory models (ie, not stacked borrows), MaybeUninit<T> wouldn't "expose" any of its contained Cells, and so it could be NoCell with no bounds on T
  • Why our current NoCell implementation (#656) bans UnsafeCell<()> and even [UnsafeCell<u8>; 0]; what would need to change in order for these to be permitted.

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