Rollup merge of #130214 - RalfJung:zeroed, r=Mark-Simulacrum · qinheping/verify-rust-std@fc53427 (original) (raw)

Original file line number Diff line number Diff line change
@@ -351,6 +351,9 @@ impl MaybeUninit {
351 351 /// but `MaybeUninit<&'static i32>::zeroed()` is not because references must not
352 352 /// be null.
353 353 ///
354 + /// Note that if `T` has padding bytes, those bytes are *not* preserved when the
355 + /// `MaybeUninit` value is returned from this function, so those bytes will *not* be zeroed.
356 + ///
354 357 /// Note that dropping a `MaybeUninit` will never call `T`'s drop code.
355 358 /// It is your responsibility to make sure `T` gets dropped if it got initialized.
356 359 ///