Skip to content

Commit 0338d34

Browse files
committed
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.
1 parent 780b0c7 commit 0338d34

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/libcore/sync/atomic.rs

-3
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ pub fn spin_loop_hint() {
124124
/// [`bool`]: ../../../std/primitive.bool.html
125125
#[cfg(target_has_atomic = "8")]
126126
#[stable(feature = "rust1", since = "1.0.0")]
127-
#[repr(transparent)]
128127
pub struct AtomicBool {
129128
v: UnsafeCell<u8>,
130129
}
@@ -148,7 +147,6 @@ unsafe impl Sync for AtomicBool {}
148147
/// This type has the same in-memory representation as a `*mut T`.
149148
#[cfg(target_has_atomic = "ptr")]
150149
#[stable(feature = "rust1", since = "1.0.0")]
151-
#[repr(transparent)]
152150
pub struct AtomicPtr<T> {
153151
p: UnsafeCell<*mut T>,
154152
}
@@ -1101,7 +1099,6 @@ macro_rules! atomic_int {
11011099
///
11021100
/// [module-level documentation]: index.html
11031101
#[$stable]
1104-
#[repr(transparent)]
11051102
pub struct $atomic_type {
11061103
v: UnsafeCell<$int_type>,
11071104
}

0 commit comments

Comments
 (0)