Skip to content

Commit 08653c8

Browse files
authored
Rollup merge of #104081 - joshlf:patch-6, r=dtolnay
PhantomData layout guarantees
2 parents 405e48f + 72a9029 commit 08653c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/core/src/marker.rs

+6
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,12 @@ impl<T: ?Sized> !Sync for *mut T {}
623623
/// (ideally) or `PhantomData<*const T>` (if no lifetime applies), so
624624
/// as not to indicate ownership.
625625
///
626+
/// ## Layout
627+
///
628+
/// For all `T`, the following are guaranteed:
629+
/// * `size_of::<PhantomData<T>>() == 0`
630+
/// * `align_of::<PhantomData<T>>() == 1`
631+
///
626632
/// [drop check]: ../../nomicon/dropck.html
627633
#[lang = "phantom_data"]
628634
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)