Skip to content

Commit 54eb376

Browse files
committed
Reword incorrect use of zeroed()
1 parent 36bb5e8 commit 54eb376

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

library/core/src/mem/maybe_uninit.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,8 @@ impl<T> MaybeUninit<T> {
336336
/// assert_eq!(x, (0, false));
337337
/// ```
338338
///
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.
339+
/// *Incorrect* usage of this function: calling `x.zeroed().assume_init()`
340+
/// when `0` is not a valid bit-pattern for the type:
342341
///
343342
/// ```rust,no_run
344343
/// use std::mem::MaybeUninit;

0 commit comments

Comments
 (0)