Skip to content

Commit

Permalink
Auto merge of #48553 - seanmonstar:atomic-debug, r=alexcrichton
Browse files Browse the repository at this point in the history
atomic: remove 'Atomic*' from Debug output

For the same reason that we don't show `Vec { data: [0, 1, 2, 3] }`, but just the array, the `AtomicUsize(1000)` is noisy, and seeing just `1000` is likely better.
  • Loading branch information
bors committed Apr 19, 2018
2 parents 8830a03 + c689db2 commit 230b97a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,9 +990,7 @@ macro_rules! atomic_int {
#[$stable_debug]
impl fmt::Debug for $atomic_type {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple(stringify!($atomic_type))
.field(&self.load(Ordering::SeqCst))
.finish()
fmt::Debug::fmt(&self.load(Ordering::SeqCst), f)
}
}

Expand Down Expand Up @@ -2090,15 +2088,15 @@ pub fn compiler_fence(order: Ordering) {
#[stable(feature = "atomic_debug", since = "1.3.0")]
impl fmt::Debug for AtomicBool {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("AtomicBool").field(&self.load(Ordering::SeqCst)).finish()
fmt::Debug::fmt(&self.load(Ordering::SeqCst), f)
}
}

#[cfg(target_has_atomic = "ptr")]
#[stable(feature = "atomic_debug", since = "1.3.0")]
impl<T> fmt::Debug for AtomicPtr<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("AtomicPtr").field(&self.load(Ordering::SeqCst)).finish()
fmt::Debug::fmt(&self.load(Ordering::SeqCst), f)
}
}

Expand Down

0 comments on commit 230b97a

Please sign in to comment.