From 36bb5e8a4247888c7e1ce5a06ba3aaf5dc9cafd5 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 21 Jul 2020 22:44:25 +0200 Subject: Clarify the doc for MaybeUninit::zeroed on incorrect use --- library/core/src/mem/maybe_uninit.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs index 7732525a0fc..b76ad7ceec9 100644 --- a/library/core/src/mem/maybe_uninit.rs +++ b/library/core/src/mem/maybe_uninit.rs @@ -336,8 +336,9 @@ impl MaybeUninit { /// assert_eq!(x, (0, false)); /// ``` /// - /// *Incorrect* usage of this function: initializing a struct with zero, where some fields - /// cannot hold 0 as a valid value. + /// *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. /// /// ```rust,no_run /// use std::mem::MaybeUninit; -- cgit 1.4.1-3-g733a5