diff options
| author | bors <bors@rust-lang.org> | 2015-12-06 04:12:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-12-06 04:12:54 +0000 |
| commit | c4b16384f101bbe28dc4eec0651a61cb9d5274ac (patch) | |
| tree | 728e8349c32af47f9985c47a55661c3a229a0571 /src/libstd/net | |
| parent | bf79ffada63fd0ad4cb0f5a0366680d27cf78ad4 (diff) | |
| parent | 464cdff102993ff1900eebbf65209e0a3c0be0d5 (diff) | |
| download | rust-c4b16384f101bbe28dc4eec0651a61cb9d5274ac.tar.gz rust-c4b16384f101bbe28dc4eec0651a61cb9d5274ac.zip | |
Auto merge of #30187 - alexcrichton:stabilize-1.6, r=aturon
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
Diffstat (limited to 'src/libstd/net')
| -rw-r--r-- | src/libstd/net/addr.rs | 11 | ||||
| -rw-r--r-- | src/libstd/net/ip.rs | 4 | ||||
| -rw-r--r-- | src/libstd/net/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/net/parser.rs | 3 |
4 files changed, 21 insertions, 1 deletions
diff --git a/src/libstd/net/addr.rs b/src/libstd/net/addr.rs index c175482bbec..9c4e2b1a54c 100644 --- a/src/libstd/net/addr.rs +++ b/src/libstd/net/addr.rs @@ -14,7 +14,9 @@ use fmt; use hash; use io; use mem; -use net::{lookup_host, ntoh, hton, IpAddr, Ipv4Addr, Ipv6Addr}; +use net::{lookup_host, ntoh, hton, Ipv4Addr, Ipv6Addr}; +#[allow(deprecated)] +use net::IpAddr; use option; use sys::net::netc as c; use sys_common::{FromInner, AsInner, IntoInner}; @@ -49,6 +51,9 @@ pub struct SocketAddrV6 { inner: c::sockaddr_in6 } impl SocketAddr { /// Creates a new socket address from the (ip, port) pair. #[unstable(feature = "ip_addr", reason = "recent addition", issue = "27801")] + #[rustc_deprecated(reason = "ip type too small a type to pull its weight", + since = "1.6.0")] + #[allow(deprecated)] pub fn new(ip: IpAddr, port: u16) -> SocketAddr { match ip { IpAddr::V4(a) => SocketAddr::V4(SocketAddrV4::new(a, port)), @@ -58,6 +63,9 @@ impl SocketAddr { /// Returns the IP address associated with this socket address. #[unstable(feature = "ip_addr", reason = "recent addition", issue = "27801")] + #[rustc_deprecated(reason = "too small a type to pull its weight", + since = "1.6.0")] + #[allow(deprecated)] pub fn ip(&self) -> IpAddr { match *self { SocketAddr::V4(ref a) => IpAddr::V4(*a.ip()), @@ -351,6 +359,7 @@ impl ToSocketAddrs for SocketAddrV6 { } #[stable(feature = "rust1", since = "1.0.0")] +#[allow(deprecated)] impl ToSocketAddrs for (IpAddr, u16) { type Iter = option::IntoIter<SocketAddr>; fn to_socket_addrs(&self) -> io::Result<option::IntoIter<SocketAddr>> { diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index c643c069971..00be17f7383 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -23,7 +23,10 @@ use sys_common::{AsInner, FromInner}; /// An IP address, either an IPv4 or IPv6 address. #[unstable(feature = "ip_addr", reason = "recent addition", issue = "27801")] +#[rustc_deprecated(reason = "too small a type to pull its weight", + since = "1.6.0")] #[derive(Copy, Clone, Eq, PartialEq, Debug, Hash, PartialOrd, Ord)] +#[allow(deprecated)] pub enum IpAddr { /// Representation of an IPv4 address. V4(Ipv4Addr), @@ -178,6 +181,7 @@ impl Ipv4Addr { } #[stable(feature = "rust1", since = "1.0.0")] +#[allow(deprecated)] impl fmt::Display for IpAddr { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { match *self { diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs index 383dce737f5..6bbbabfc269 100644 --- a/src/libstd/net/mod.rs +++ b/src/libstd/net/mod.rs @@ -18,6 +18,7 @@ use io::{self, Error, ErrorKind}; use sys_common::net as net_imp; #[stable(feature = "rust1", since = "1.0.0")] +#[allow(deprecated)] pub use self::ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::addr::{SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs}; @@ -136,6 +137,9 @@ pub fn lookup_host(host: &str) -> io::Result<LookupHost> { /// cannot be resolved, it is returned in string format. #[unstable(feature = "lookup_addr", reason = "recent addition", issue = "27705")] +#[rustc_deprecated(reason = "ipaddr type is being deprecated", + since = "1.6.0")] +#[allow(deprecated)] pub fn lookup_addr(addr: &IpAddr) -> io::Result<String> { net_imp::lookup_addr(addr) } diff --git a/src/libstd/net/parser.rs b/src/libstd/net/parser.rs index 1619dac78ca..79a269ff87c 100644 --- a/src/libstd/net/parser.rs +++ b/src/libstd/net/parser.rs @@ -17,6 +17,7 @@ use prelude::v1::*; use error::Error; use fmt; +#[allow(deprecated)] use net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; use str::FromStr; @@ -261,6 +262,7 @@ impl<'a> Parser<'a> { self.read_atomically(|p| p.read_ipv6_addr_impl()) } + #[allow(deprecated)] fn read_ip_addr(&mut self) -> Option<IpAddr> { let ipv4_addr = |p: &mut Parser| p.read_ipv4_addr().map(IpAddr::V4); let ipv6_addr = |p: &mut Parser| p.read_ipv6_addr().map(IpAddr::V6); @@ -306,6 +308,7 @@ impl<'a> Parser<'a> { } #[stable(feature = "rust1", since = "1.0.0")] +#[allow(deprecated)] impl FromStr for IpAddr { type Err = AddrParseError; fn from_str(s: &str) -> Result<IpAddr, AddrParseError> { |
