MaybeUninit::zeroed: mention that padding is not zeroed
This commit is contained in:
parent
a9fb00bfa4
commit
d4ac759542
1 changed files with 3 additions and 0 deletions
|
|
@ -351,6 +351,9 @@ impl<T> MaybeUninit<T> {
|
|||
/// but `MaybeUninit<&'static i32>::zeroed()` is not because references must not
|
||||
/// be null.
|
||||
///
|
||||
/// Note that if `T` has padding bytes, those bytes are *not* preserved when the
|
||||
/// `MaybeUninit<T>` value is returned from this function, so those bytes will *not* be zeroed.
|
||||
///
|
||||
/// Note that dropping a `MaybeUninit<T>` will never call `T`'s drop code.
|
||||
/// It is your responsibility to make sure `T` gets dropped if it got initialized.
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue