Skip to content

Commit

Permalink
Remove #[repr(transparent)] from atomics
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexcrichton committed Sep 5, 2018
1 parent 780b0c7 commit 0338d34
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/libcore/sync/atomic.rs
Expand Up @@ -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<u8>,
}
Expand All @@ -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<T> {
p: UnsafeCell<*mut T>,
}
Expand Down Expand Up @@ -1101,7 +1099,6 @@ macro_rules! atomic_int {
///
/// [module-level documentation]: index.html
#[$stable]
#[repr(transparent)]
pub struct $atomic_type {
v: UnsafeCell<$int_type>,
}
Expand Down

0 comments on commit 0338d34

Please sign in to comment.