We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4c96a9 commit 586c7e3Copy full SHA for 586c7e3
src/liballoc/rc.rs
@@ -259,6 +259,10 @@ use crate::vec::Vec;
259
#[cfg(test)]
260
mod tests;
261
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)]
266
struct RcBox<T: ?Sized> {
267
strong: Cell<usize>,
268
weak: Cell<usize>,
src/liballoc/sync.rs
@@ -270,6 +270,10 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Weak<T> {
270
}
271
272
273
274
275
276
277
struct ArcInner<T: ?Sized> {
278
strong: atomic::AtomicUsize,
279
0 commit comments