Skip to content

Commit 5c7ca77

Browse files
committed
Make the size of Option<NonZero*> a documented guarantee.
Closes #49137, the tracking issue for `NonZero*`, as this was the last remaining open question. Note that `ptr::NonNull<T>` already documents a similar guarantee.
1 parent 4a9c58c commit 5c7ca77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/num/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ macro_rules! nonzero_integers {
3939
$(
4040
/// An integer that is known not to equal zero.
4141
///
42-
/// This may enable some memory layout optimization such as:
42+
/// This enables some memory layout optimization.
43+
/// For example, `Option<NonZeroU32>` is the same size as `u32`:
4344
///
4445
/// ```rust
45-
/// # #![feature(nonzero)]
4646
/// use std::mem::size_of;
4747
/// assert_eq!(size_of::<Option<std::num::NonZeroU32>>(), size_of::<u32>());
4848
/// ```

0 commit comments

Comments
 (0)