diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2016-03-07 15:42:29 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-03-12 12:31:13 -0800 |
| commit | b53764c73bd722ea22142bace6249d5950066253 (patch) | |
| tree | ecf0066dbdb65bf0cf4600c4560d06edcacff707 /src/libstd/sys/common | |
| parent | 083db64d9050ae6f92628aa869171ac4affb016f (diff) | |
| download | rust-b53764c73bd722ea22142bace6249d5950066253.tar.gz rust-b53764c73bd722ea22142bace6249d5950066253.zip | |
std: Clean out deprecated APIs
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
Diffstat (limited to 'src/libstd/sys/common')
| -rw-r--r-- | src/libstd/sys/common/net.rs | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index aa92e5be114..42714feb921 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -11,15 +11,13 @@ use prelude::v1::*; use cmp; -use ffi::{CStr, CString}; +use ffi::CString; use fmt; use io::{self, Error, ErrorKind}; -use libc::{c_int, c_char, c_void}; +use libc::{c_int, c_void}; use mem; -#[allow(deprecated)] -use net::{SocketAddr, Shutdown, IpAddr, Ipv4Addr, Ipv6Addr}; +use net::{SocketAddr, Shutdown, Ipv4Addr, Ipv6Addr}; use ptr; -use str::from_utf8; use sys::net::{cvt, cvt_r, cvt_gai, Socket, init, wrlen_t}; use sys::net::netc as c; use sys_common::{AsInner, FromInner, IntoInner}; @@ -155,34 +153,6 @@ pub fn lookup_host(host: &str) -> io::Result<LookupHost> { } //////////////////////////////////////////////////////////////////////////////// -// lookup_addr -//////////////////////////////////////////////////////////////////////////////// - -#[allow(deprecated)] -pub fn lookup_addr(addr: &IpAddr) -> io::Result<String> { - init(); - - let saddr = SocketAddr::new(*addr, 0); - let (inner, len) = saddr.into_inner(); - let mut hostbuf = [0 as c_char; c::NI_MAXHOST as usize]; - - let data = unsafe { - try!(cvt_gai(c::getnameinfo(inner, len, - hostbuf.as_mut_ptr(), - c::NI_MAXHOST, - ptr::null_mut(), 0, 0))); - - CStr::from_ptr(hostbuf.as_ptr()) - }; - - match from_utf8(data.to_bytes()) { - Ok(name) => Ok(name.to_owned()), - Err(_) => Err(io::Error::new(io::ErrorKind::Other, - "failed to lookup address information")) - } -} - -//////////////////////////////////////////////////////////////////////////////// // TCP streams //////////////////////////////////////////////////////////////////////////////// |
