diff options
| author | Alexis Bourget <alexis.bourget@gmail.com> | 2020-07-21 22:44:25 +0200 |
|---|---|---|
| committer | Alexis Bourget <alexis.bourget@gmail.com> | 2020-07-28 18:54:15 +0200 |
| commit | 36bb5e8a4247888c7e1ce5a06ba3aaf5dc9cafd5 (patch) | |
| tree | 590ecf8635963c2c13cbdbb480b1e4b0f7b65054 | |
| parent | 2c28244cf0fc9868f55070e55b8f332d196eaf3f (diff) | |
| download | rust-36bb5e8a4247888c7e1ce5a06ba3aaf5dc9cafd5.tar.gz rust-36bb5e8a4247888c7e1ce5a06ba3aaf5dc9cafd5.zip | |
Clarify the doc for MaybeUninit::zeroed on incorrect use
| -rw-r--r-- | library/core/src/mem/maybe_uninit.rs | 5 |
1 files 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<T> MaybeUninit<T> { /// 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; |
