Skip to content

Commit 69a3009

Browse files
authored
Rollup merge of #64837 - nliberg:patch-2, r=Centril
Improve wording in documentation of MaybeUninit Changes > variables are properly initialized **at** their respective type into > variables are properly initialized **as** their respective type
2 parents d9168e4 + fd505d7 commit 69a3009

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libcore/mem/maybe_uninit.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use crate::mem::ManuallyDrop;
55
///
66
/// # Initialization invariant
77
///
8-
/// The compiler, in general, assumes that variables are properly initialized
9-
/// at their respective type. For example, a variable of reference type must
10-
/// be aligned and non-NULL. This is an invariant that must *always* be upheld,
11-
/// even in unsafe code. As a consequence, zero-initializing a variable of reference
12-
/// type causes instantaneous [undefined behavior][ub], no matter whether that reference
13-
/// ever gets used to access memory:
8+
/// The compiler, in general, assumes that a variable is properly initialized
9+
/// according to the requirements of the variable's type. For example, a variable of
10+
/// reference type must be aligned and non-NULL. This is an invariant that must
11+
/// *always* be upheld, even in unsafe code. As a consequence, zero-initializing a
12+
/// variable of reference type causes instantaneous [undefined behavior][ub],
13+
/// no matter whether that reference ever gets used to access memory:
1414
///
1515
/// ```rust,no_run
1616
/// # #![allow(invalid_value)]

0 commit comments

Comments
 (0)