about summary refs log tree commit diff
path: root/src/libstd/sys/unix/ext/io.rs
diff options
context:
space:
mode:
authorTobias Schaffner <tschaff@genua.de>2017-08-16 11:06:58 +0200
committerTobias Schaffner <tschaff@genua.de>2017-08-16 13:27:20 +0200
commit2ccaeff5822fd866fd9e695b9ca51893167be35c (patch)
tree3ed5f509f8e93cc85d7827dc3e435010ec654a0d /src/libstd/sys/unix/ext/io.rs
parent4fc3765c5477f98cfdf325475b2b01c6c094ed2d (diff)
downloadrust-2ccaeff5822fd866fd9e695b9ca51893167be35c.tar.gz
rust-2ccaeff5822fd866fd9e695b9ca51893167be35c.zip
Refactoring: move net specific fd imps to net
Move the implementations of net specific file descriptior implementations
to net. This makes it easier to exclude net at all if not needed for a
target.
Diffstat (limited to 'src/libstd/sys/unix/ext/io.rs')
-rw-r--r--src/libstd/sys/unix/ext/io.rs57
1 files changed, 1 insertions, 56 deletions
diff --git a/src/libstd/sys/unix/ext/io.rs b/src/libstd/sys/unix/ext/io.rs
index a0323d933d6..c9fe3590a64 100644
--- a/src/libstd/sys/unix/ext/io.rs
+++ b/src/libstd/sys/unix/ext/io.rs
@@ -13,11 +13,10 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use fs;
-use net;
 use os::raw;
 use sys;
 use io;
-use sys_common::{self, AsInner, FromInner, IntoInner};
+use sys_common::{AsInner, FromInner, IntoInner};
 use libc;
 
 /// Raw file descriptors.
@@ -93,19 +92,6 @@ impl IntoRawFd for fs::File {
     }
 }
 
-#[stable(feature = "rust1", since = "1.0.0")]
-impl AsRawFd for net::TcpStream {
-    fn as_raw_fd(&self) -> RawFd { *self.as_inner().socket().as_inner() }
-}
-#[stable(feature = "rust1", since = "1.0.0")]
-impl AsRawFd for net::TcpListener {
-    fn as_raw_fd(&self) -> RawFd { *self.as_inner().socket().as_inner() }
-}
-#[stable(feature = "rust1", since = "1.0.0")]
-impl AsRawFd for net::UdpSocket {
-    fn as_raw_fd(&self) -> RawFd { *self.as_inner().socket().as_inner() }
-}
-
 #[stable(feature = "asraw_stdio", since = "1.21.0")]
 impl AsRawFd for io::Stdin {
     fn as_raw_fd(&self) -> RawFd { libc::STDIN_FILENO }
@@ -120,44 +106,3 @@ impl AsRawFd for io::Stdout {
 impl AsRawFd for io::Stderr {
     fn as_raw_fd(&self) -> RawFd { libc::STDERR_FILENO }
 }
-
-#[stable(feature = "from_raw_os", since = "1.1.0")]
-impl FromRawFd for net::TcpStream {
-    unsafe fn from_raw_fd(fd: RawFd) -> net::TcpStream {
-        let socket = sys::net::Socket::from_inner(fd);
-        net::TcpStream::from_inner(sys_common::net::TcpStream::from_inner(socket))
-    }
-}
-#[stable(feature = "from_raw_os", since = "1.1.0")]
-impl FromRawFd for net::TcpListener {
-    unsafe fn from_raw_fd(fd: RawFd) -> net::TcpListener {
-        let socket = sys::net::Socket::from_inner(fd);
-        net::TcpListener::from_inner(sys_common::net::TcpListener::from_inner(socket))
-    }
-}
-#[stable(feature = "from_raw_os", since = "1.1.0")]
-impl FromRawFd for net::UdpSocket {
-    unsafe fn from_raw_fd(fd: RawFd) -> net::UdpSocket {
-        let socket = sys::net::Socket::from_inner(fd);
-        net::UdpSocket::from_inner(sys_common::net::UdpSocket::from_inner(socket))
-    }
-}
-
-#[stable(feature = "into_raw_os", since = "1.4.0")]
-impl IntoRawFd for net::TcpStream {
-    fn into_raw_fd(self) -> RawFd {
-        self.into_inner().into_socket().into_inner()
-    }
-}
-#[stable(feature = "into_raw_os", since = "1.4.0")]
-impl IntoRawFd for net::TcpListener {
-    fn into_raw_fd(self) -> RawFd {
-        self.into_inner().into_socket().into_inner()
-    }
-}
-#[stable(feature = "into_raw_os", since = "1.4.0")]
-impl IntoRawFd for net::UdpSocket {
-    fn into_raw_fd(self) -> RawFd {
-        self.into_inner().into_socket().into_inner()
-    }
-}