We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 584d1bd commit ae4961aCopy full SHA for ae4961a
core/src/mem/mod.rs
@@ -666,6 +666,11 @@ pub unsafe fn zeroed<T>() -> T {
666
/// As the [`assume_init` documentation][assume_init] explains,
667
/// [the Rust compiler assumes][inv] that values are properly initialized.
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
+///
674
/// Therefore, it is immediate undefined behavior to call this function on nearly all types,
675
/// including integer types and arrays of integer types, and even if the result is unused.
676
0 commit comments