mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Rollup merge of #104081 - joshlf:patch-6, r=dtolnay
PhantomData layout guarantees
This commit is contained in:
commit
08653c8c57
@ -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")]
|
||||
|
Loading…
Reference in New Issue
Block a user