External Publication
Visit Post

Idea / Pre-RFC: Null-free pointer and Zeroable reference

Rust Internals [Unofficial] March 7, 2026
Source

H4n_uL:

doesn't that confirm the gap has to be closed below the library level?

That's why I proposed those two functions as additions to the standard library earlier. I think having read/write/copy and copy_non_overlapping variants in core would make sense. But anything more complex that that belongs in a third-party crate.

They are not strictly necessary, since read_volatile works. But that sacrifices performance and const.

H4n_uL:

Cell exists to hide references behind interior mutability;

Cell's purpose is to enable shared single threaded mutability. It will become much more useful once you can manipulate individual fields of a struct.

The benefits for MaybeUninit are smaller, but there are no soundness issues with projecting a &mut MaybeUninit<Struct> to a &mut MaybeUninit<Field> either.

H4n_uL:

Without field projection, it doesn't become verbose; it fails to be what it is.

Verbose field projection can be implemented in a library already. So native field projection is only an ergonomics improvement.

Discussion in the ATmosphere

Loading comments...