Skip to content

Commit

Permalink
Rollup merge of #104081 - joshlf:patch-6, r=dtolnay
Browse files Browse the repository at this point in the history
PhantomData layout guarantees
  • Loading branch information
matthiaskrgr authored Jan 7, 2023
2 parents 405e48f + 72a9029 commit 08653c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,12 @@ impl<T: ?Sized> !Sync for *mut T {}
/// (ideally) or `PhantomData<*const T>` (if no lifetime applies), so
/// as not to indicate ownership.
///
/// ## Layout
///
/// For all `T`, the following are guaranteed:
/// * `size_of::<PhantomData<T>>() == 0`
/// * `align_of::<PhantomData<T>>() == 1`
///
/// [drop check]: ../../nomicon/dropck.html
#[lang = "phantom_data"]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down

0 comments on commit 08653c8

Please sign in to comment.