]> git.lizzy.rs Git - rust.git/commitdiff
fix doctest
authorRalf Jung <post@ralfj.de>
Tue, 5 Feb 2019 16:22:46 +0000 (17:22 +0100)
committerRalf Jung <post@ralfj.de>
Tue, 5 Feb 2019 17:46:43 +0000 (18:46 +0100)
src/libcore/mem.rs

index 68f985ce65202b9eb5df0f739a26959489096d95..18302e36ff762955b8f17bb5cdd8f19819660a0b 100644 (file)
@@ -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.