about summary refs log tree commit diff
path: root/src/libcore/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-19 23:08:16 +0000
committerbors <bors@rust-lang.org>2018-04-19 23:08:16 +0000
commit230b97af1cfda750148e7f0e168b6dcc9d692957 (patch)
treee20ae13302f409878b48985c3ee1d2a656b498ce /src/libcore/sync
parent8830a0304327ba8c983555ac5d42cec0569c31bb (diff)
parentc689db2c463f42422ff4ee47e28ebeb2865951ba (diff)
downloadrust-230b97af1cfda750148e7f0e168b6dcc9d692957.tar.gz
rust-230b97af1cfda750148e7f0e168b6dcc9d692957.zip
Auto merge of #48553 - seanmonstar:atomic-debug, r=alexcrichton
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.
Diffstat (limited to 'src/libcore/sync')
-rw-r--r--src/libcore/sync/atomic.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
index cf3842dbe27..7aba8b51cff 100644
--- a/src/libcore/sync/atomic.rs
+++ b/src/libcore/sync/atomic.rs
@@ -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)
             }
         }
 
@@ -2090,7 +2088,7 @@ 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)
     }
 }
 
@@ -2098,7 +2096,7 @@ impl fmt::Debug for AtomicBool {
 #[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)
     }
 }