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> {
1045
1045
/// ```rust,no_run
1046
1046
/// use std::mem;
1047
1047
///
1048
- /// let x: &i32 = mem::zeroed(); // undefined behavior!
1048
+ /// let x: &i32 = unsafe { mem::zeroed() } ; // undefined behavior!
1049
1049
/// ```
1050
1050
/// This is exploited by the compiler for various optimizations, such as eliding
1051
1051
/// run-time checks and optimizing `enum` layout.
@@ -1058,6 +1058,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
1058
1058
/// it is a signal to the compiler indicating that the data here might *not*
1059
1059
/// be initialized:
1060
1060
/// ```rust
1061
+ /// #![feature(maybe_uninit)]
1061
1062
/// use std::mem::MaybeUninit;
1062
1063
///
1063
1064
/// // Create an explicitly uninitialized reference.
You can’t perform that action at this time.
0 commit comments