We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b331b86 commit f3eede6Copy full SHA for f3eede6
src/libcore/mem.rs
@@ -1045,7 +1045,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
1045
/// ```rust,no_run
1046
/// use std::mem;
1047
///
1048
-/// let x: &i32 = mem::zeroed(); // undefined behavior!
+/// let x: &i32 = unsafe { mem::zeroed() }; // undefined behavior!
1049
/// ```
1050
/// This is exploited by the compiler for various optimizations, such as eliding
1051
/// run-time checks and optimizing `enum` layout.
@@ -1058,6 +1058,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
1058
/// it is a signal to the compiler indicating that the data here might *not*
1059
/// be initialized:
1060
/// ```rust
1061
+/// #![feature(maybe_uninit)]
1062
/// use std::mem::MaybeUninit;
1063
1064
/// // Create an explicitly uninitialized reference.
0 commit comments