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/io/stdio.rs | |
| 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/io/stdio.rs')
| -rw-r--r-- | src/libstd/io/stdio.rs | 42 | 
1 files changed, 42 insertions, 0 deletions
| diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 1a65bee13b8..9d1c8942f8c 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -282,6 +282,13 @@ impl Stdin { } } +#[stable(feature = "std_debug", since = "1.15.0")] +impl fmt::Debug for Stdin { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.pad("Stdin { .. }") + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl Read for Stdin { fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { @@ -314,6 +321,13 @@ impl<'a> BufRead for StdinLock<'a> { fn consume(&mut self, n: usize) { self.inner.consume(n) } } +#[stable(feature = "std_debug", since = "1.15.0")] +impl<'a> fmt::Debug for StdinLock<'a> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.pad("StdinLock { .. }") + } +} + /// A handle to the global standard output stream of the current process. /// /// Each handle shares a global buffer of data to be written to the standard @@ -424,6 +438,13 @@ impl Stdout { } } +#[stable(feature = "std_debug", since = "1.15.0")] +impl fmt::Debug for Stdout { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.pad("Stdout { .. }") + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl Write for Stdout { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { @@ -449,6 +470,13 @@ impl<'a> Write for StdoutLock<'a> { } } +#[stable(feature = "std_debug", since = "1.15.0")] +impl<'a> fmt::Debug for StdoutLock<'a> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.pad("StdoutLock { .. }") + } +} + /// A handle to the standard error stream of a process. /// /// For more information, see the [`io::stderr`] method. @@ -545,6 +573,13 @@ impl Stderr { } } +#[stable(feature = "std_debug", since = "1.15.0")] +impl fmt::Debug for Stderr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.pad("Stderr { .. }") + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl Write for Stderr { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { @@ -570,6 +605,13 @@ impl<'a> Write for StderrLock<'a> { } } +#[stable(feature = "std_debug", since = "1.15.0")] +impl<'a> fmt::Debug for StderrLock<'a> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.pad("StderrLock { .. }") + } +} + /// Resets the thread-local stderr handle to the specified writer /// /// This will replace the current thread's stderr handle, returning the old | 
