Skip to content

Commit

Permalink
Remove duplicate sentence fragment from mem::zeroed doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jun 18, 2020
1 parent e75fa89 commit 2da9ca7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libcore/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,10 @@ pub const fn needs_drop<T>() -> bool {
///
/// There is no guarantee that an all-zero byte-pattern represents a valid value
/// of some type `T`. For example, the all-zero byte-pattern is not a valid value
/// for reference types (`&T`, `&mut T`) and functions pointers. Using `zeroed` on
/// such types on such types causes immediate [undefined behavior][ub] because
/// [the Rust compiler assumes][inv] that there always is a valid value in a
/// variable it considers initialized.
/// for reference types (`&T`, `&mut T`) and functions pointers. Using `zeroed`
/// on such types causes immediate [undefined behavior][ub] because [the Rust
/// compiler assumes][inv] that there always is a valid value in a variable it
/// considers initialized.
///
/// This has the same effect as [`MaybeUninit::zeroed().assume_init()`][zeroed].
/// It is useful for FFI sometimes, but should generally be avoided.
Expand Down

0 comments on commit 2da9ca7

Please sign in to comment.