about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authornwin <nwin@users.noreply.github.com>2015-02-20 13:09:29 +0100
committernwin <nwin@users.noreply.github.com>2015-02-26 10:18:13 +0100
commit36ba96ea3cfef575ddc5eea7754a1b70b50e2080 (patch)
treeafab6aecaf1a531545cdeab04c88ae52d717c9d5 /src/liballoc
parent522d09dfecbeca1595f25ac58c6d0178bbd21d7d (diff)
downloadrust-36ba96ea3cfef575ddc5eea7754a1b70b50e2080.tar.gz
rust-36ba96ea3cfef575ddc5eea7754a1b70b50e2080.zip
Implement `Debug` for `RwLock`, `arc::Weak` and `Mutex`
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index 934e6ab2159..8cd27125646 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -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,