Commit 5e8f95b 1 parent 73a30f8 commit 5e8f95b Copy full SHA for 5e8f95b
File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -666,6 +666,11 @@ pub unsafe fn zeroed<T>() -> T {
666
666
/// As the [`assume_init` documentation][assume_init] explains,
667
667
/// [the Rust compiler assumes][inv] that values are properly initialized.
668
668
///
669
+ /// Truly uninitialized memory like what gets returned here
670
+ /// is special in that the compiler knows that it does not have a fixed value.
671
+ /// This makes it undefined behavior to have uninitialized data in a variable even
672
+ /// if that variable has an integer type.
673
+ ///
669
674
/// Therefore, it is immediate undefined behavior to call this function on nearly all types,
670
675
/// including integer types and arrays of integer types, and even if the result is unused.
671
676
///
You can’t perform that action at this time.
0 commit comments