diff options
| -rw-r--r-- | library/core/src/marker/variance.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/library/core/src/marker/variance.rs b/library/core/src/marker/variance.rs index 23334e6575d..235f8a3bb79 100644 --- a/library/core/src/marker/variance.rs +++ b/library/core/src/marker/variance.rs @@ -136,6 +136,8 @@ phantom_lifetime! { /// For all `'a`, the following are guaranteed: /// * `size_of::<PhantomCovariantLifetime<'a>>() == 0` /// * `align_of::<PhantomCovariantLifetime<'a>>() == 1` + #[rustc_pub_transparent] + #[repr(transparent)] pub struct PhantomCovariantLifetime<'a>(PhantomCovariant<&'a ()>); /// Zero-sized type used to mark a lifetime as contravariant. /// @@ -149,6 +151,8 @@ phantom_lifetime! { /// For all `'a`, the following are guaranteed: /// * `size_of::<PhantomContravariantLifetime<'a>>() == 0` /// * `align_of::<PhantomContravariantLifetime<'a>>() == 1` + #[rustc_pub_transparent] + #[repr(transparent)] pub struct PhantomContravariantLifetime<'a>(PhantomContravariant<&'a ()>); /// Zero-sized type used to mark a lifetime as invariant. /// @@ -162,6 +166,8 @@ phantom_lifetime! { /// For all `'a`, the following are guaranteed: /// * `size_of::<PhantomInvariantLifetime<'a>>() == 0` /// * `align_of::<PhantomInvariantLifetime<'a>>() == 1` + #[rustc_pub_transparent] + #[repr(transparent)] pub struct PhantomInvariantLifetime<'a>(PhantomInvariant<&'a ()>); } @@ -179,6 +185,8 @@ phantom_type! { /// For all `T`, the following are guaranteed: /// * `size_of::<PhantomCovariant<T>>() == 0` /// * `align_of::<PhantomCovariant<T>>() == 1` + #[rustc_pub_transparent] + #[repr(transparent)] pub struct PhantomCovariant<T>(PhantomData<fn() -> T>); /// Zero-sized type used to mark a type parameter as contravariant. /// @@ -193,6 +201,8 @@ phantom_type! { /// For all `T`, the following are guaranteed: /// * `size_of::<PhantomContravariant<T>>() == 0` /// * `align_of::<PhantomContravariant<T>>() == 1` + #[rustc_pub_transparent] + #[repr(transparent)] pub struct PhantomContravariant<T>(PhantomData<fn(T)>); /// Zero-sized type used to mark a type parameter as invariant. /// @@ -206,6 +216,8 @@ phantom_type! { /// For all `T`, the following are guaranteed: /// * `size_of::<PhantomInvariant<T>>() == 0` /// * `align_of::<PhantomInvariant<T>>() == 1` + #[rustc_pub_transparent] + #[repr(transparent)] pub struct PhantomInvariant<T>(PhantomData<fn(T) -> T>); } |
