Skip to content

Commit

Permalink
Rollup merge of rust-lang#53979 - alexcrichton:remove-repr-transparen…
Browse files Browse the repository at this point in the history
…t-atomics-master, r=sfackler

Remove `#[repr(transparent)]` from atomics

Added in rust-lang#52149 the discussion in rust-lang#53514 is showing how we may not want to
actually add this attribute to the atomic types. While we continue to
debate rust-lang#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
kennytm committed Sep 7, 2018
2 parents 1681b15 + 0338d34 commit 9b70ef7
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
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 9b70ef7

Please sign in to comment.