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> {
306306#[ cfg_attr( not( test) , rustc_diagnostic_item = "Rc" ) ]
307307#[ stable( feature = "rust1" , since = "1.0.0" ) ]
308308#[ rustc_insignificant_dtor]
309+ #[ repr( transparent) ]
309310pub struct Rc < T : ?Sized > {
310311 ptr : NonNull < RcBox < T > > ,
311312 phantom : PhantomData < RcBox < T > > ,
@@ -2143,6 +2144,7 @@ impl<T, I: iter::TrustedLen<Item = T>> ToRcSlice<T> for I {
21432144///
21442145/// [`upgrade`]: Weak::upgrade
21452146#[ stable( feature = "rc_weak" , since = "1.4.0" ) ]
2147+ #[ repr( transparent) ]
21462148pub struct Weak < T : ?Sized > {
21472149 // This is a `NonNull` to allow optimizing the size of this type in enums,
21482150 // 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 {
232232/// [rc_examples]: crate::rc#examples
233233#[ cfg_attr( not( test) , rustc_diagnostic_item = "Arc" ) ]
234234#[ stable( feature = "rust1" , since = "1.0.0" ) ]
235+ #[ repr( transparent) ]
235236pub struct Arc < T : ?Sized > {
236237 ptr : NonNull < ArcInner < T > > ,
237238 phantom : PhantomData < ArcInner < T > > ,
@@ -282,6 +283,7 @@ impl<T: ?Sized> Arc<T> {
282283///
283284/// [`upgrade`]: Weak::upgrade
284285#[ stable( feature = "arc_weak" , since = "1.4.0" ) ]
286+ #[ repr( transparent) ]
285287pub struct Weak < T : ?Sized > {
286288 // This is a `NonNull` to allow optimizing the size of this type in enums,
287289 // but it is not necessarily a valid pointer.
You can’t perform that action at this time.
0 commit comments