Skip to content

Commit b751548

Browse files
committed
tweak MaybeUninit docs
1 parent 51748a8 commit b751548

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

library/core/src/mem/maybe_uninit.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ use crate::ptr;
3939
/// let b: bool = unsafe { MaybeUninit::uninit().assume_init() }; // undefined behavior! ⚠️
4040
/// ```
4141
///
42-
/// Moreover, uninitialized memory is special in that the compiler knows that
43-
/// it does not have a fixed value. This makes it undefined behavior to have
44-
/// uninitialized data in a variable even if that variable has an integer type,
45-
/// which otherwise can hold any *fixed* bit pattern:
42+
/// Moreover, uninitialized memory is special in that it does not have a fixed value ("fixed"
43+
/// meaning "it won't change without being written to"). Reading the same uninitialized byte
44+
/// multiple times can give different results. This makes it undefined behavior to have
45+
/// uninitialized data in a variable even if that variable has an integer type, which otherwise can
46+
/// hold any *fixed* bit pattern:
4647
///
4748
/// ```rust,no_run
4849
/// # #![allow(invalid_value)]

0 commit comments

Comments
 (0)