From 0338d340c4ad64dde20dfa5ab8b983861e58c631 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 5 Sep 2018 15:37:39 -0700 Subject: [PATCH] Remove `#[repr(transparent)]` from atomics Added in #52149 the discussion in #53514 is showing how we may not want to actually add this attribute to the atomic types. While we continue to debate #53514 this commit reverts the addition of the `transparent` attribute. This should be a more conservative route which leaves us the ability to tweak this in the future but in the meantime allows us to continue discussion as well. --- src/libcore/sync/atomic.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 617e067e078..602f8d4ee71 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -124,7 +124,6 @@ pub fn spin_loop_hint() { /// [`bool`]: ../../../std/primitive.bool.html #[cfg(target_has_atomic = "8")] #[stable(feature = "rust1", since = "1.0.0")] -#[repr(transparent)] pub struct AtomicBool { v: UnsafeCell, } @@ -148,7 +147,6 @@ unsafe impl Sync for AtomicBool {} /// This type has the same in-memory representation as a `*mut T`. #[cfg(target_has_atomic = "ptr")] #[stable(feature = "rust1", since = "1.0.0")] -#[repr(transparent)] pub struct AtomicPtr { p: UnsafeCell<*mut T>, } @@ -1101,7 +1099,6 @@ macro_rules! atomic_int { /// /// [module-level documentation]: index.html #[$stable] - #[repr(transparent)] pub struct $atomic_type { v: UnsafeCell<$int_type>, }