@@ -494,7 +494,7 @@ pub const fn needs_drop<T>() -> bool {
494
494
///
495
495
/// *Incorrect* usage of this function: initializing a reference with zero.
496
496
///
497
- /// ```
497
+ /// ```no_run
498
498
/// use std::mem;
499
499
///
500
500
/// let _x: &i32 = unsafe { mem::zeroed() }; // Undefined behavior!
@@ -987,7 +987,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
987
987
///
988
988
/// On top of that, remember that most types have additional invariants beyond merely
989
989
/// being considered initialized at the type level. For example, a `1`-initialized [`Vec<T>`]
990
- /// is considered initialized because the only requirement the compiler knows about
990
+ /// is considered initialized because the only requirement the compiler knows about it
991
991
/// is that the data pointer must be non-null. Creating such a `Vec<T>` does not cause
992
992
/// *immediate* undefined behavior, but will cause undefined behavior with most
993
993
/// safe operations (including dropping it).
@@ -1025,8 +1025,8 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
1025
1025
///
1026
1026
/// let data = unsafe {
1027
1027
/// // Create an uninitialized array of `MaybeUninit`. The `assume_init` is
1028
- /// // safe because we type we are claiming to have initialized here is a
1029
- /// // bunch of `MaybeUninit`, which do not require initialization.
1028
+ /// // safe because the type we are claiming to have initialized here is a
1029
+ /// // bunch of `MaybeUninit`s , which do not require initialization.
1030
1030
/// let mut data: [MaybeUninit<Vec<u32>>; 1000] = MaybeUninit::uninit().assume_init();
1031
1031
///
1032
1032
/// // Dropping a `MaybeUninit` does nothing, so if there is a panic during this loop,
@@ -1052,9 +1052,9 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
1052
1052
///
1053
1053
/// unsafe {
1054
1054
/// // Create an uninitialized array of `MaybeUninit`. The `assume_init` is
1055
- /// // safe because we type we are claiming to have initialized here is a
1056
- /// // bunch of `MaybeUninit`, which do not require initialization.
1057
- /// let mut data: [MaybeUninit<String>; 500 ] = MaybeUninit::uninit().assume_init();
1055
+ /// // safe because the type we are claiming to have initialized here is a
1056
+ /// // bunch of `MaybeUninit`s , which do not require initialization.
1057
+ /// let mut data: [MaybeUninit<String>; 1000 ] = MaybeUninit::uninit().assume_init();
1058
1058
/// // Count the number of elements we have assigned.
1059
1059
/// let mut data_len: usize = 0;
1060
1060
///
0 commit comments