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 73a30f8 commit 5e8f95b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/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 5e8f95b

Please sign in to comment.