rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.85k stars 268 forks source link

ptr::NonNull is stable #214

Closed SNCPlay42 closed 4 years ago

SNCPlay42 commented 4 years ago

In src/vec-layout.md:

Unfortunately the mechanism for stating that your value is non-zero is unstable and unlikely to be stabilized soon. As such we're just going to take the hit and use std's Unique:

std::ptr::NonNull is stable since 1.25, while std::ptr::Unique is still feature-gated and even hidden from documentation. This should be updated to avoid unnecessarily using unstable features.

SNCPlay42 commented 4 years ago

Confusingly enough the final code chapter uses NonNull. Looks like it's out of sync with the other chapters?

SNCPlay42 commented 4 years ago

This was discussed in the comments of #161 but is not currently fixed in that PR. It seems likely that any PR fixing this will have merge conflicts with that one.

SNCPlay42 commented 4 years ago

Dupes #160