fix doctests

This commit is contained in:
Ralf Jung 2019-02-06 11:14:12 +01:00
parent b331b86d30
commit f3eede6870

View file

@ -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.