Skip to content

Commit

Permalink
fix doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Feb 5, 2019
1 parent 789b4d1 commit aaafc3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
/// even in unsafe code. As a consequence, 0-initializing a variable of reference
/// type causes instantaneous undefined behavior, no matter whether that reference
/// ever gets used to access memory:
/// ```rust,ignore
/// ```rust,no_run
/// use std::mem;
///
/// let x: &i32 = mem::zeroed(); // undefined behavior!
Expand All @@ -1065,7 +1065,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
/// // Set it to a valid value.
/// x.set(&0);
/// // Extract the initialized data -- this is only allowed *after* properly
/// initializing `x`!
/// // initializing `x`!
/// let x = unsafe { x.into_initialized() };
/// ```
/// The compiler then knows to not optimize this code.
Expand Down

0 comments on commit aaafc3c

Please sign in to comment.