]> git.lizzy.rs Git - rust.git/blobdiff - src/liballoc/arc.rs
Auto merge of #22573 - nwin:impl-debug-rwlock-weak, r=Manishearth
[rust.git] / src / liballoc / arc.rs
index cc49164ef91b349f78e716bf3b7c6962392ad9c8..88a3752c88a1d6774b8b288a2a12f2af0e566e61 100644 (file)
@@ -139,6 +139,13 @@ pub struct Weak<T> {
 unsafe impl<T: Sync + Send> Send for Weak<T> { }
 unsafe impl<T: Sync + Send> Sync for Weak<T> { }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<T: fmt::Debug> fmt::Debug for Weak<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "(Weak)")
+    }
+}
+
 struct ArcInner<T> {
     strong: atomic::AtomicUsize,
     weak: atomic::AtomicUsize,