Skip to content

Commit f3eede6

Browse files
committed
fix doctests
1 parent b331b86 commit f3eede6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libcore/mem.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
10451045
/// ```rust,no_run
10461046
/// use std::mem;
10471047
///
1048-
/// let x: &i32 = mem::zeroed(); // undefined behavior!
1048+
/// let x: &i32 = unsafe { mem::zeroed() }; // undefined behavior!
10491049
/// ```
10501050
/// This is exploited by the compiler for various optimizations, such as eliding
10511051
/// run-time checks and optimizing `enum` layout.
@@ -1058,6 +1058,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
10581058
/// it is a signal to the compiler indicating that the data here might *not*
10591059
/// be initialized:
10601060
/// ```rust
1061+
/// #![feature(maybe_uninit)]
10611062
/// use std::mem::MaybeUninit;
10621063
///
10631064
/// // Create an explicitly uninitialized reference.

0 commit comments

Comments
 (0)