Implement Debug for RwLock, arc::Weak and Mutex

This commit is contained in:
nwin
2015-02-20 13:09:29 +01:00
parent 522d09dfec
commit 36ba96ea3c
3 changed files with 35 additions and 0 deletions

View 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,