diff options
Diffstat (limited to 'src/libstd/panic.rs')
| -rw-r--r-- | src/libstd/panic.rs | 10 |
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 |
