File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,10 @@ use crate::vec::Vec;
259259#[ cfg( test) ]
260260mod tests;
261261
262+ // This is repr(C) to future-proof against possible field-reordering, which
263+ // would interfere with otherwise safe [into|from]_raw() of transmutable
264+ // inner types.
265+ #[ repr( C ) ]
262266struct RcBox < T : ?Sized > {
263267 strong : Cell < usize > ,
264268 weak : Cell < usize > ,
Original file line number Diff line number Diff line change @@ -270,6 +270,10 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Weak<T> {
270270 }
271271}
272272
273+ // This is repr(C) to future-proof against possible field-reordering, which
274+ // would interfere with otherwise safe [into|from]_raw() of transmutable
275+ // inner types.
276+ #[ repr( C ) ]
273277struct ArcInner < T : ?Sized > {
274278 strong : atomic:: AtomicUsize ,
275279
You can’t perform that action at this time.
0 commit comments