diff options
| author | Alexis Bourget <alexis.bourget@gmail.com> | 2020-08-01 19:28:19 +0200 |
|---|---|---|
| committer | Alexis Bourget <alexis.bourget@gmail.com> | 2020-08-01 19:28:19 +0200 |
| commit | 54eb3768e0077bc18152b5fc3d19824cde69c8ce (patch) | |
| tree | 29d245b68bda2e851fcc76d089a58216c7db785f | |
| parent | 36bb5e8a4247888c7e1ce5a06ba3aaf5dc9cafd5 (diff) | |
| download | rust-54eb3768e0077bc18152b5fc3d19824cde69c8ce.tar.gz rust-54eb3768e0077bc18152b5fc3d19824cde69c8ce.zip | |
Reword incorrect use of zeroed()
| -rw-r--r-- | library/core/src/mem/maybe_uninit.rs | 5 |
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; |
