File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments