about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-02-06 11:14:12 +0100
committerRalf Jung <post@ralfj.de>2019-02-06 11:14:12 +0100
commitf3eede6870c817e2e22782ad08d31fcaa8c6b640 (patch)
tree10d6baebac858e3b27d6d1ffa69913931652482c /src
parentb331b86d308d09398cf6202f367ea0f02babe523 (diff)
downloadrust-f3eede6870c817e2e22782ad08d31fcaa8c6b640.tar.gz
rust-f3eede6870c817e2e22782ad08d31fcaa8c6b640.zip
fix doctests
Diffstat (limited to 'src')
-rw-r--r--src/libcore/mem.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs
index 18302e36ff7..930fe737a72 100644
--- a/src/libcore/mem.rs
+++ b/src/libcore/mem.rs
@@ -1045,7 +1045,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
 /// ```rust,no_run
 /// use std::mem;
 ///
-/// let x: &i32 = mem::zeroed(); // undefined behavior!
+/// let x: &i32 = unsafe { mem::zeroed() }; // undefined behavior!
 /// ```
 /// This is exploited by the compiler for various optimizations, such as eliding
 /// run-time checks and optimizing `enum` layout.
@@ -1058,6 +1058,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
 /// it is a signal to the compiler indicating that the data here might *not*
 /// be initialized:
 /// ```rust
+/// #![feature(maybe_uninit)]
 /// use std::mem::MaybeUninit;
 ///
 /// // Create an explicitly uninitialized reference.