From ac77392f8ab1c201b0c927f6a2d30b632b95acda Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 31 Mar 2015 16:01:03 -0700 Subject: std: Stabilize last bits of io::Error This commit stabilizes a few remaining bits of the `io::Error` type: * The `Error::new` method is now stable. The last `detail` parameter was removed and the second `desc` parameter was generalized to `E: Into>` to allow creating an I/O error from any form of error. Currently there is no form of downcasting, but this will be added in time. * An implementation of `From<&str> for Box` was added to liballoc to allow construction of errors from raw strings. * The `Error::raw_os_error` method was stabilized as-is. * Trait impls for `Clone`, `Eq`, and `PartialEq` were removed from `Error` as it is not possible to use them with trait objects. This is a breaking change due to the modification of the `new` method as well as the removal of the trait implementations for the `Error` type. [breaking-change] --- src/libstd/net/addr.rs | 2 +- src/libstd/net/mod.rs | 2 +- src/libstd/net/udp.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstd/net') diff --git a/src/libstd/net/addr.rs b/src/libstd/net/addr.rs index a08b33b342b..eb6cb441606 100644 --- a/src/libstd/net/addr.rs +++ b/src/libstd/net/addr.rs @@ -435,7 +435,7 @@ impl ToSocketAddrs for str { match $e { Some(r) => r, None => return Err(io::Error::new(io::ErrorKind::InvalidInput, - $msg, None)), + $msg)), } ) } diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs index ee57300765e..a152b98822a 100644 --- a/src/libstd/net/mod.rs +++ b/src/libstd/net/mod.rs @@ -72,7 +72,7 @@ fn each_addr(addr: A, mut f: F) -> io::Result } Err(last_err.unwrap_or_else(|| { Error::new(ErrorKind::InvalidInput, - "could not resolve to any addresses", None) + "could not resolve to any addresses") })) } diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs index 81151114962..511c2e3f8b2 100644 --- a/src/libstd/net/udp.rs +++ b/src/libstd/net/udp.rs @@ -76,7 +76,7 @@ impl UdpSocket { match try!(addr.to_socket_addrs()).next() { Some(addr) => self.0.send_to(buf, &addr), None => Err(Error::new(ErrorKind::InvalidInput, - "no addresses to send data to", None)), + "no addresses to send data to")), } } -- cgit 1.4.1-3-g733a5