From aaafc3c7fa1846b952b1a479ed69420b9b3f86bb Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 5 Feb 2019 17:22:46 +0100 Subject: [PATCH] fix doctest --- src/libcore/mem.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 68f985ce652..18302e36ff7 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -1042,7 +1042,7 @@ fn deref_mut(&mut self) -> &mut 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! @@ -1065,7 +1065,7 @@ fn deref_mut(&mut self) -> &mut 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.