Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std: Deprecate the std::old_io::net primitives #22813

Merged
merged 1 commit into from
Mar 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/libstd/old_io/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

//! Networking I/O

#![deprecated(since = "1.0.0",
reason = "replaced with new I/O primitives in `std::net`")]
#![unstable(feature = "old_io")]

use old_io::{IoError, IoResult, InvalidInput};
use ops::FnMut;
use option::Option::None;
Expand Down
6 changes: 6 additions & 0 deletions src/libstd/old_io/net/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
//! instances as clients.

#![allow(missing_docs)]
#![deprecated(since = "1.0.0",
reason = "will be removed to be reintroduced at a later date; \
in the meantime consider using the `unix_socket` crate \
for unix sockets; there is currently no replacement \
for named pipes")]
#![unstable(feature = "old_io")]

use prelude::v1::*;

Expand Down
2 changes: 2 additions & 0 deletions src/libstd/sys/common/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![allow(deprecated)]

use prelude::v1::*;
use self::SocketStatus::*;
use self::InAddr::*;
Expand Down
7 changes: 7 additions & 0 deletions src/libstd/sys/unix/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,42 +73,49 @@ impl AsRawFd for old_io::pipe::PipeStream {
}
}

#[allow(deprecated)]
impl AsRawFd for old_io::net::pipe::UnixStream {
fn as_raw_fd(&self) -> Fd {
self.as_inner().fd()
}
}

#[allow(deprecated)]
impl AsRawFd for old_io::net::pipe::UnixListener {
fn as_raw_fd(&self) -> Fd {
self.as_inner().fd()
}
}

#[allow(deprecated)]
impl AsRawFd for old_io::net::pipe::UnixAcceptor {
fn as_raw_fd(&self) -> Fd {
self.as_inner().fd()
}
}

#[allow(deprecated)]
impl AsRawFd for old_io::net::tcp::TcpStream {
fn as_raw_fd(&self) -> Fd {
self.as_inner().fd()
}
}

#[allow(deprecated)]
impl AsRawFd for old_io::net::tcp::TcpListener {
fn as_raw_fd(&self) -> Fd {
self.as_inner().fd()
}
}

#[allow(deprecated)]
impl AsRawFd for old_io::net::tcp::TcpAcceptor {
fn as_raw_fd(&self) -> Fd {
self.as_inner().fd()
}
}

#[allow(deprecated)]
impl AsRawFd for old_io::net::udp::UdpSocket {
fn as_raw_fd(&self) -> Fd {
self.as_inner().fd()
Expand Down
2 changes: 2 additions & 0 deletions src/libstd/sys/unix/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![allow(deprecated)]

use prelude::v1::*;

use old_io::net::ip;
Expand Down
7 changes: 7 additions & 0 deletions src/libstd/sys/windows/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,21 @@ impl AsRawHandle for old_io::pipe::PipeStream {
}
}

#[allow(deprecated)]
impl AsRawHandle for old_io::net::pipe::UnixStream {
fn as_raw_handle(&self) -> Handle {
self.as_inner().handle()
}
}

#[allow(deprecated)]
impl AsRawHandle for old_io::net::pipe::UnixListener {
fn as_raw_handle(&self) -> Handle {
self.as_inner().handle()
}
}

#[allow(deprecated)]
impl AsRawHandle for old_io::net::pipe::UnixAcceptor {
fn as_raw_handle(&self) -> Handle {
self.as_inner().handle()
Expand All @@ -81,24 +84,28 @@ pub trait AsRawSocket {
fn as_raw_socket(&self) -> Socket;
}

#[allow(deprecated)]
impl AsRawSocket for old_io::net::tcp::TcpStream {
fn as_raw_socket(&self) -> Socket {
self.as_inner().fd()
}
}

#[allow(deprecated)]
impl AsRawSocket for old_io::net::tcp::TcpListener {
fn as_raw_socket(&self) -> Socket {
self.as_inner().socket()
}
}

#[allow(deprecated)]
impl AsRawSocket for old_io::net::tcp::TcpAcceptor {
fn as_raw_socket(&self) -> Socket {
self.as_inner().socket()
}
}

#[allow(deprecated)]
impl AsRawSocket for old_io::net::udp::UdpSocket {
fn as_raw_socket(&self) -> Socket {
self.as_inner().fd()
Expand Down
2 changes: 2 additions & 0 deletions src/libstd/sys/windows/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![allow(deprecated)]

use old_io::net::ip;
use old_io::IoResult;
use libc;
Expand Down