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/net | |
| 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/net')
| -rw-r--r-- | src/libstd/net/mod.rs | 8 | ||||
| -rw-r--r-- | src/libstd/net/tcp.rs | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs index 56286fbe253..cadf87f32b1 100644 --- a/src/libstd/net/mod.rs +++ b/src/libstd/net/mod.rs @@ -12,6 +12,7 @@ #![stable(feature = "rust1", since = "1.0.0")] +use fmt; use io::{self, Error, ErrorKind}; use sys_common::net as net_imp; @@ -105,6 +106,13 @@ impl Iterator for LookupHost { fn next(&mut self) -> Option<SocketAddr> { self.0.next() } } +#[stable(feature = "std_debug", since = "1.15.0")] +impl fmt::Debug for LookupHost { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.pad("LookupHost { .. }") + } +} + /// Resolve the host specified by `host` as a number of `SocketAddr` instances. /// /// This method may perform a DNS query to resolve `host` and may also inspect diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index be9636a0a19..63817c9f10f 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -76,6 +76,7 @@ pub struct TcpListener(net_imp::TcpListener); /// [`incoming`]: struct.TcpListener.html#method.incoming /// [`TcpListener`]: struct.TcpListener.html #[stable(feature = "rust1", since = "1.0.0")] +#[derive(Debug)] pub struct Incoming<'a> { listener: &'a TcpListener } impl TcpStream { |
