External Publication
Visit Post

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

Rust Internals [Unofficial] March 8, 2026
Source

H4n_uL:

As noted above, this has already led to a soundness issue.

The "soundness issue" is that I'm using a dummy implementation for the new core::ptr functions I proposed. You could replace it by read_volatile today and mark the calling functions non-const. Then it will work and be sound today, just a bit slower.

H4n_uL:

this may seem like an excessive solution at first glance

It is an excessive solution, since the benefits are so small. The use-cases you address are extremely rare, and already have usable workarounds today. And in the end, Rust doesn't have to be usable for every single application.

You can of course continue to argue for complex solutions which have absolutely no chance of being accepted. Or you could try to find low impact solutions (like the handful of functions I proposed) which help your use-cases without impacting Rust at large. Those might actually have a chance of happening.

Discussion in the ATmosphere

Loading comments...