@@ -136,6 +136,8 @@ phantom_lifetime! {
136
136
/// For all `'a`, the following are guaranteed:
137
137
/// * `size_of::<PhantomCovariantLifetime<'a>>() == 0`
138
138
/// * `align_of::<PhantomCovariantLifetime<'a>>() == 1`
139
+ #[ rustc_pub_transparent]
140
+ #[ repr( transparent) ]
139
141
pub struct PhantomCovariantLifetime <' a>( PhantomCovariant <& ' a ( ) >) ;
140
142
/// Zero-sized type used to mark a lifetime as contravariant.
141
143
///
@@ -149,6 +151,8 @@ phantom_lifetime! {
149
151
/// For all `'a`, the following are guaranteed:
150
152
/// * `size_of::<PhantomContravariantLifetime<'a>>() == 0`
151
153
/// * `align_of::<PhantomContravariantLifetime<'a>>() == 1`
154
+ #[ rustc_pub_transparent]
155
+ #[ repr( transparent) ]
152
156
pub struct PhantomContravariantLifetime <' a>( PhantomContravariant <& ' a ( ) >) ;
153
157
/// Zero-sized type used to mark a lifetime as invariant.
154
158
///
@@ -162,6 +166,8 @@ phantom_lifetime! {
162
166
/// For all `'a`, the following are guaranteed:
163
167
/// * `size_of::<PhantomInvariantLifetime<'a>>() == 0`
164
168
/// * `align_of::<PhantomInvariantLifetime<'a>>() == 1`
169
+ #[ rustc_pub_transparent]
170
+ #[ repr( transparent) ]
165
171
pub struct PhantomInvariantLifetime <' a>( PhantomInvariant <& ' a ( ) >) ;
166
172
}
167
173
@@ -179,6 +185,8 @@ phantom_type! {
179
185
/// For all `T`, the following are guaranteed:
180
186
/// * `size_of::<PhantomCovariant<T>>() == 0`
181
187
/// * `align_of::<PhantomCovariant<T>>() == 1`
188
+ #[ rustc_pub_transparent]
189
+ #[ repr( transparent) ]
182
190
pub struct PhantomCovariant <T >( PhantomData <fn ( ) -> T >) ;
183
191
/// Zero-sized type used to mark a type parameter as contravariant.
184
192
///
@@ -193,6 +201,8 @@ phantom_type! {
193
201
/// For all `T`, the following are guaranteed:
194
202
/// * `size_of::<PhantomContravariant<T>>() == 0`
195
203
/// * `align_of::<PhantomContravariant<T>>() == 1`
204
+ #[ rustc_pub_transparent]
205
+ #[ repr( transparent) ]
196
206
pub struct PhantomContravariant <T >( PhantomData <fn ( T ) >) ;
197
207
/// Zero-sized type used to mark a type parameter as invariant.
198
208
///
@@ -206,6 +216,8 @@ phantom_type! {
206
216
/// For all `T`, the following are guaranteed:
207
217
/// * `size_of::<PhantomInvariant<T>>() == 0`
208
218
/// * `align_of::<PhantomInvariant<T>>() == 1`
219
+ #[ rustc_pub_transparent]
220
+ #[ repr( transparent) ]
209
221
pub struct PhantomInvariant <T >( PhantomData <fn ( T ) -> T >) ;
210
222
}
211
223
0 commit comments