Skip to content

Commit

Permalink
Re-add some justification
Browse files Browse the repository at this point in the history
  • Loading branch information
5225225 committed Aug 26, 2022
1 parent 584d1bd commit ae4961a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down

0 comments on commit ae4961a

Please sign in to comment.