diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2018-06-06 13:46:51 +0200 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2018-06-06 13:58:09 +0200 |
| commit | 5c7ca77b173e170f7440ba2cb5898cfc33874681 (patch) | |
| tree | 455bc49ff0ad6ed469874dac515b3706111acc3b /src | |
| parent | 4a9c58c6bd0e609538053a35685e206f66019820 (diff) | |
| download | rust-5c7ca77b173e170f7440ba2cb5898cfc33874681.tar.gz rust-5c7ca77b173e170f7440ba2cb5898cfc33874681.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/num/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 26dd08b10b9..c2da9006a8a 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -39,10 +39,10 @@ macro_rules! nonzero_integers { $( /// An integer that is known not to equal zero. /// - /// This may enable some memory layout optimization such as: + /// This enables some memory layout optimization. + /// For example, `Option<NonZeroU32>` is the same size as `u32`: /// /// ```rust - /// # #![feature(nonzero)] /// use std::mem::size_of; /// assert_eq!(size_of::<Option<std::num::NonZeroU32>>(), size_of::<u32>()); /// ``` |
