diff options
| author | bors <bors@rust-lang.org> | 2015-02-27 10:35:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-27 10:35:51 +0000 |
| commit | bd0d8e47e53f25bbd50418a0f117973c366c1b08 (patch) | |
| tree | e7d24e6d09c3d9c6c52500cd91290e0674f6714e /src/liballoc | |
| parent | bd27985457d4afc7c0a6218e8e1c30fdf359e48c (diff) | |
| parent | 36ba96ea3cfef575ddc5eea7754a1b70b50e2080 (diff) | |
| download | rust-bd0d8e47e53f25bbd50418a0f117973c366c1b08.tar.gz rust-bd0d8e47e53f25bbd50418a0f117973c366c1b08.zip | |
Auto merge of #22573 - nwin:impl-debug-rwlock-weak, r=Manishearth
Implements `Debug` for `RwLock` and `arc::Weak` in the same way it is implemented for `rc::Weak` (basically copy & paste). The lack of this implementation prevents the automatic implementation of `Debug` for structs containing members of these types.
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index cc49164ef91..88a3752c88a 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, |
