Skip to content

Commit

Permalink
Unrolled build for rust-lang#115522
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#115522 - joshlf:patch-8, r=scottmcm

Clarify ManuallyDrop bit validity

Clarify that `ManuallyDrop<T>` has the same bit validity as `T`.
  • Loading branch information
rust-timer authored Oct 6, 2023
2 parents 6683f13 + a16622f commit 1d3b8df
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions library/core/src/mem/manually_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use crate::ptr;
/// A wrapper to inhibit compiler from automatically calling `T`’s destructor.
/// This wrapper is 0-cost.
///
/// `ManuallyDrop<T>` is guaranteed to have the same layout as `T`, and is subject
/// to the same layout optimizations as `T`. As a consequence, it has *no effect*
/// on the assumptions that the compiler makes about its contents. For example,
/// initializing a `ManuallyDrop<&mut T>` with [`mem::zeroed`] is undefined
/// behavior. If you need to handle uninitialized data, use [`MaybeUninit<T>`]
/// instead.
/// `ManuallyDrop<T>` is guaranteed to have the same layout and bit validity as
/// `T`, and is subject to the same layout optimizations as `T`. As a consequence,
/// it has *no effect* on the assumptions that the compiler makes about its
/// contents. For example, initializing a `ManuallyDrop<&mut T>` with [`mem::zeroed`]
/// is undefined behavior. If you need to handle uninitialized data, use
/// [`MaybeUninit<T>`] instead.
///
/// Note that accessing the value inside a `ManuallyDrop<T>` is safe.
/// This means that a `ManuallyDrop<T>` whose content has been dropped must not
Expand Down

0 comments on commit 1d3b8df

Please sign in to comment.