diff options
| author | Corey Farwell <coreyf@rwell.org> | 2016-11-25 13:21:49 -0500 |
|---|---|---|
| committer | Corey Farwell <coreyf@rwell.org> | 2016-12-18 14:55:14 -0800 |
| commit | 86fc63e62ddc0a271210b8cc7cc2a6de6874b8f8 (patch) | |
| tree | b4b2329077e4e537719a8f0556525c66d4d8f73c /src/libstd/sys/unix | |
| parent | 1f965cc8e9dc8f8b26eac99cffdef6501cf0c617 (diff) | |
| download | rust-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/sys/unix')
| -rw-r--r-- | src/libstd/sys/unix/fast_thread_local.rs | 7 | ||||
| -rw-r--r-- | src/libstd/sys/unix/fd.rs | 1 | ||||
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/fast_thread_local.rs b/src/libstd/sys/unix/fast_thread_local.rs index 0c625e7add9..f4f73646e1b 100644 --- a/src/libstd/sys/unix/fast_thread_local.rs +++ b/src/libstd/sys/unix/fast_thread_local.rs @@ -12,6 +12,7 @@ #![unstable(feature = "thread_local_internals", issue = "0")] use cell::{Cell, UnsafeCell}; +use fmt; use intrinsics; use ptr; @@ -24,6 +25,12 @@ pub struct Key<T> { dtor_running: Cell<bool>, } +impl<T> fmt::Debug for Key<T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.pad("Key { .. }") + } +} + unsafe impl<T> ::marker::Sync for Key<T> { } impl<T> Key<T> { diff --git a/src/libstd/sys/unix/fd.rs b/src/libstd/sys/unix/fd.rs index 61eb60da486..2384d959881 100644 --- a/src/libstd/sys/unix/fd.rs +++ b/src/libstd/sys/unix/fd.rs @@ -18,6 +18,7 @@ use sys::cvt; use sys_common::AsInner; use sys_common::io::read_to_end_uninitialized; +#[derive(Debug)] pub struct FileDesc { fd: c_int, } diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 9ee0458b5da..8b5c0c04276 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -66,7 +66,7 @@ pub struct DirEntry { name: Box<[u8]> } -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct OpenOptions { // generic read: bool, @@ -86,6 +86,7 @@ pub struct FilePermissions { mode: mode_t } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] pub struct FileType { mode: mode_t } +#[derive(Debug)] pub struct DirBuilder { mode: mode_t } impl FileAttr { |
