File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,7 @@ struct RcBox<T: ?Sized> {
306
306
#[ cfg_attr( not( test) , rustc_diagnostic_item = "Rc" ) ]
307
307
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
308
308
#[ rustc_insignificant_dtor]
309
+ #[ repr( transparent) ]
309
310
pub struct Rc < T : ?Sized > {
310
311
ptr : NonNull < RcBox < T > > ,
311
312
phantom : PhantomData < RcBox < T > > ,
@@ -2143,6 +2144,7 @@ impl<T, I: iter::TrustedLen<Item = T>> ToRcSlice<T> for I {
2143
2144
///
2144
2145
/// [`upgrade`]: Weak::upgrade
2145
2146
#[ stable( feature = "rc_weak" , since = "1.4.0" ) ]
2147
+ #[ repr( transparent) ]
2146
2148
pub struct Weak < T : ?Sized > {
2147
2149
// This is a `NonNull` to allow optimizing the size of this type in enums,
2148
2150
// but it is not necessarily a valid pointer.
Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ macro_rules! acquire {
232
232
/// [rc_examples]: crate::rc#examples
233
233
#[ cfg_attr( not( test) , rustc_diagnostic_item = "Arc" ) ]
234
234
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
235
+ #[ repr( transparent) ]
235
236
pub struct Arc < T : ?Sized > {
236
237
ptr : NonNull < ArcInner < T > > ,
237
238
phantom : PhantomData < ArcInner < T > > ,
@@ -282,6 +283,7 @@ impl<T: ?Sized> Arc<T> {
282
283
///
283
284
/// [`upgrade`]: Weak::upgrade
284
285
#[ stable( feature = "arc_weak" , since = "1.4.0" ) ]
286
+ #[ repr( transparent) ]
285
287
pub struct Weak < T : ?Sized > {
286
288
// This is a `NonNull` to allow optimizing the size of this type in enums,
287
289
// but it is not necessarily a valid pointer.
You can’t perform that action at this time.
0 commit comments