Remove duplicate sentence fragment from mem::zeroed doc

This commit is contained in:
David Tolnay 2020-06-17 17:17:07 -07:00
parent e75fa896ba
commit 2da9ca72bc
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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 /// 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 /// 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 /// for reference types (`&T`, `&mut T`) and functions pointers. Using `zeroed`
/// such types on such types causes immediate [undefined behavior][ub] because /// on such types causes immediate [undefined behavior][ub] because [the Rust
/// [the Rust compiler assumes][inv] that there always is a valid value in a /// compiler assumes][inv] that there always is a valid value in a variable it
/// variable it considers initialized. /// considers initialized.
/// ///
/// This has the same effect as [`MaybeUninit::zeroed().assume_init()`][zeroed]. /// This has the same effect as [`MaybeUninit::zeroed().assume_init()`][zeroed].
/// It is useful for FFI sometimes, but should generally be avoided. /// It is useful for FFI sometimes, but should generally be avoided.