From 5c7ca77b173e170f7440ba2cb5898cfc33874681 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 6 Jun 2018 13:46:51 +0200 Subject: [PATCH] Make the size of Option a documented guarantee. Closes #49137, the tracking issue for `NonZero*`, as this was the last remaining open question. Note that `ptr::NonNull` already documents a similar guarantee. --- src/libcore/num/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 26dd08b10b9b8..c2da9006a8a92 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` is the same size as `u32`: /// /// ```rust - /// # #![feature(nonzero)] /// use std::mem::size_of; /// assert_eq!(size_of::>(), size_of::()); /// ```