Skip to content

Commit 0605f63

Browse files
authored
Reference memory model byte definition
1 parent 21f6fa2 commit 0605f63

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/core/src/mem/maybe_uninit.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ use crate::{fmt, intrinsics, ptr, slice};
255255
///
256256
/// # Validity
257257
///
258-
/// A `MaybeUninit<T>` has no validity requirement – any sequence of bytes of the appropriate length,
259-
/// initialized to any value or uninitialized, are a valid value of `MaybeUninit<T>`.
258+
/// A `MaybeUninit<T>` has no validity requirement – any sequence of [bytes][reference-byte] of the
259+
/// appropriate length, initialized to any value or uninitialized, are a valid value of `MaybeUninit<T>`.
260260
///
261261
/// However, "round-tripping" via `MaybeUninit` does not always result in the original value.
262262
/// Concretely, given distinct `T` and `U` where `size_of::<T>() == size_of::<U>()`, the following
@@ -280,6 +280,8 @@ use crate::{fmt, intrinsics, ptr, slice};
280280
///
281281
/// Note that, so long as no such byte offsets exist, then the preceding `identity` example *is* sound.
282282
///
283+
/// [reference-byte]: ../../reference/memory-model.html#bytes
284+
///
283285
/// ## Provenance
284286
///
285287
/// As stated above, `MaybeUninit` permits any byte value at any byte offset. This includes values

0 commit comments

Comments
 (0)