diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-08-01 17:42:11 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-01 17:42:11 -0700 |
| commit | 39436ebe72991f3c5e1247aa74a4f609187f3f01 (patch) | |
| tree | ef678ff0afcb7975f02fb3114ef62f1a3f2ae2b1 | |
| parent | 05762e3d6f5facafdd47efdf4203021fadf61bb1 (diff) | |
| parent | 54eb3768e0077bc18152b5fc3d19824cde69c8ce (diff) | |
| download | rust-39436ebe72991f3c5e1247aa74a4f609187f3f01.tar.gz rust-39436ebe72991f3c5e1247aa74a4f609187f3f01.zip | |
Rollup merge of #74602 - poliorcetics:maybe-uninit-zeroed-doc-clarification, r=jyn514
Clarify the doc for MaybeUninit::zeroed on incorrect use Fixes #74343. @rustbot modify labels: C-enhancement, T-doc
| -rw-r--r-- | library/core/src/mem/maybe_uninit.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs index 7732525a0fc..cf721b01ce3 100644 --- a/library/core/src/mem/maybe_uninit.rs +++ b/library/core/src/mem/maybe_uninit.rs @@ -336,8 +336,8 @@ 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: calling `x.zeroed().assume_init()` + /// when `0` is not a valid bit-pattern for the type: /// /// ```rust,no_run /// use std::mem::MaybeUninit; |
