Skip to content

Commit 39436eb

Browse files
authored
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
2 parents 05762e3 + 54eb376 commit 39436eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/mem/maybe_uninit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ impl<T> MaybeUninit<T> {
336336
/// assert_eq!(x, (0, false));
337337
/// ```
338338
///
339-
/// *Incorrect* usage of this function: initializing a struct with zero, where some fields
340-
/// cannot hold 0 as a valid value.
339+
/// *Incorrect* usage of this function: calling `x.zeroed().assume_init()`
340+
/// when `0` is not a valid bit-pattern for the type:
341341
///
342342
/// ```rust,no_run
343343
/// use std::mem::MaybeUninit;

0 commit comments

Comments
 (0)