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
This commit is contained in:
commit
39436ebe72
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue