Skip to content

Leverage core::marker::Freeze #941

Closed

Description

@jswrenn

With rust-lang/rust#121501, Rust may expose and subsequently stabilize the Freeze trait, which is automatically implemented for all types free of UnsafeCell (excluding by indirection such as &UnsafeCell). This is analogous to our NoCell trait, but our trait must be explicitly derived.

Once Freeze is stabilized, we should first emit a

where
     Self: Freeze

bound on the definition of NoCell when zerocopy is compiled with sufficiently-recent toolchains.

Then, we should consider whether to eliminate our NoCell trait altogether in favor of re-exporting Freeze as NoCell.

Activity

  1. added 3 commits that reference this issue on Mar 10, 2024
  2. added a commit that references this issue on Mar 11, 2024
  3. joshlf commented on May 3, 2024

    @joshlf
    Member

    We've decided that our Immutable will need to have slightly different semantics than stdlib Freeze - namely, it bans interior mutability recursively (ie, even via reference/pointer indirection), while Freeze does not. See #1155.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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