Skip to content

Commit 36bb5e8

Browse files
committed
Clarify the doc for MaybeUninit::zeroed on incorrect use
1 parent 2c28244 commit 36bb5e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/core/src/mem/maybe_uninit.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,9 @@ 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: assuming zero filled memory is initialized,
340+
/// where some fields cannot hold 0 as a valid value, without overwriting with a
341+
/// valid bit-pattern.
341342
///
342343
/// ```rust,no_run
343344
/// use std::mem::MaybeUninit;

0 commit comments

Comments
 (0)