Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed May 1, 2019
1 parent 1547cce commit 478a3b0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ pub const fn needs_drop<T>() -> bool {
///
/// *Incorrect* usage of this function: initializing a reference with zero.
///
/// ```
/// ```no_run
/// use std::mem;
///
/// let _x: &i32 = unsafe { mem::zeroed() }; // Undefined behavior!
Expand Down Expand Up @@ -987,7 +987,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
///
/// On top of that, remember that most types have additional invariants beyond merely
/// being considered initialized at the type level. For example, a `1`-initialized [`Vec<T>`]
/// is considered initialized because the only requirement the compiler knows about
/// is considered initialized because the only requirement the compiler knows about it
/// is that the data pointer must be non-null. Creating such a `Vec<T>` does not cause
/// *immediate* undefined behavior, but will cause undefined behavior with most
/// safe operations (including dropping it).
Expand Down Expand Up @@ -1025,8 +1025,8 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
///
/// let data = unsafe {
/// // Create an uninitialized array of `MaybeUninit`. The `assume_init` is
/// // safe because we type we are claiming to have initialized here is a
/// // bunch of `MaybeUninit`, which do not require initialization.
/// // safe because the type we are claiming to have initialized here is a
/// // bunch of `MaybeUninit`s, which do not require initialization.
/// let mut data: [MaybeUninit<Vec<u32>>; 1000] = MaybeUninit::uninit().assume_init();
///
/// // Dropping a `MaybeUninit` does nothing, so if there is a panic during this loop,
Expand All @@ -1052,9 +1052,9 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
///
/// unsafe {
/// // Create an uninitialized array of `MaybeUninit`. The `assume_init` is
/// // safe because we type we are claiming to have initialized here is a
/// // bunch of `MaybeUninit`, which do not require initialization.
/// let mut data: [MaybeUninit<String>; 500] = MaybeUninit::uninit().assume_init();
/// // safe because the type we are claiming to have initialized here is a
/// // bunch of `MaybeUninit`s, which do not require initialization.
/// let mut data: [MaybeUninit<String>; 1000] = MaybeUninit::uninit().assume_init();
/// // Count the number of elements we have assigned.
/// let mut data_len: usize = 0;
///
Expand Down

0 comments on commit 478a3b0

Please sign in to comment.