about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexis Bourget <alexis.bourget@gmail.com>2020-08-01 19:28:19 +0200
committerAlexis Bourget <alexis.bourget@gmail.com>2020-08-01 19:28:19 +0200
commit54eb3768e0077bc18152b5fc3d19824cde69c8ce (patch)
tree29d245b68bda2e851fcc76d089a58216c7db785f
parent36bb5e8a4247888c7e1ce5a06ba3aaf5dc9cafd5 (diff)
downloadrust-54eb3768e0077bc18152b5fc3d19824cde69c8ce.tar.gz
rust-54eb3768e0077bc18152b5fc3d19824cde69c8ce.zip
Reword incorrect use of zeroed()
-rw-r--r--library/core/src/mem/maybe_uninit.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs
index b76ad7ceec9..cf721b01ce3 100644
--- a/library/core/src/mem/maybe_uninit.rs
+++ b/library/core/src/mem/maybe_uninit.rs
@@ -336,9 +336,8 @@ impl<T> MaybeUninit<T> {
     /// assert_eq!(x, (0, false));
     /// ```
     ///
-    /// *Incorrect* usage of this function: assuming zero filled memory is initialized,
-    /// where some fields cannot hold 0 as a valid value, without overwriting with a
-    /// valid bit-pattern.
+    /// *Incorrect* usage of this function: calling `x.zeroed().assume_init()`
+    /// when `0` is not a valid bit-pattern for the type:
     ///
     /// ```rust,no_run
     /// use std::mem::MaybeUninit;