about summary refs log tree commit diff
path: root/src/libstd/panic.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2016-11-25 13:21:49 -0500
committerCorey Farwell <coreyf@rwell.org>2016-12-18 14:55:14 -0800
commit86fc63e62ddc0a271210b8cc7cc2a6de6874b8f8 (patch)
treeb4b2329077e4e537719a8f0556525c66d4d8f73c /src/libstd/panic.rs
parent1f965cc8e9dc8f8b26eac99cffdef6501cf0c617 (diff)
downloadrust-86fc63e62ddc0a271210b8cc7cc2a6de6874b8f8.tar.gz
rust-86fc63e62ddc0a271210b8cc7cc2a6de6874b8f8.zip
Implement `fmt::Debug` for all structures in libstd.
Part of https://github.com/rust-lang/rust/issues/31869.

Also turn on the `missing_debug_implementations` lint at the crate
level.
Diffstat (limited to 'src/libstd/panic.rs')
-rw-r--r--src/libstd/panic.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs
index a7e8c4fab37..faf4949e861 100644
--- a/src/libstd/panic.rs
+++ b/src/libstd/panic.rs
@@ -14,6 +14,7 @@
 
 use any::Any;
 use cell::UnsafeCell;
+use fmt;
 use ops::{Deref, DerefMut};
 use panicking;
 use ptr::{Unique, Shared};
@@ -296,6 +297,15 @@ impl<R, F: FnOnce() -> R> FnOnce<()> for AssertUnwindSafe<F> {
     }
 }
 
+#[stable(feature = "std_debug", since = "1.15.0")]
+impl<T: fmt::Debug> fmt::Debug for AssertUnwindSafe<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_tuple("AssertUnwindSafe")
+            .field(&self.0)
+            .finish()
+    }
+}
+
 /// Invokes a closure, capturing the cause of an unwinding panic if one occurs.
 ///
 /// This function will return `Ok` with the closure's result if the closure