Re-add some justification
This commit is contained in:
parent
73a30f8d8b
commit
5e8f95ba7d
@ -666,6 +666,11 @@ pub unsafe fn zeroed<T>() -> T {
|
||||
/// As the [`assume_init` documentation][assume_init] explains,
|
||||
/// [the Rust compiler assumes][inv] that values are properly initialized.
|
||||
///
|
||||
/// Truly uninitialized memory like what gets returned here
|
||||
/// is special in that the compiler knows that it does not have a fixed value.
|
||||
/// This makes it undefined behavior to have uninitialized data in a variable even
|
||||
/// if that variable has an integer type.
|
||||
///
|
||||
/// Therefore, it is immediate undefined behavior to call this function on nearly all types,
|
||||
/// including integer types and arrays of integer types, and even if the result is unused.
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user