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.
This commit is contained in:
parent
1f965cc8e9
commit
86fc63e62d
31 changed files with 515 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue