diff options
| author | bors <bors@rust-lang.org> | 2015-01-27 02:46:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-27 02:46:09 +0000 |
| commit | a6a6fadbb97268d2b3e47649d91053fbb4827266 (patch) | |
| tree | 66fdcc5956c3fad65f8484243903edf8771ad3a1 /src/libstd/sys/common | |
| parent | a637365b10c175e23af40171af1724d5474cb303 (diff) | |
| parent | 5d836cdf8666ce0af6911a0c89dffea4da74b374 (diff) | |
| download | rust-a6a6fadbb97268d2b3e47649d91053fbb4827266.tar.gz rust-a6a6fadbb97268d2b3e47649d91053fbb4827266.zip | |
Auto merge of #21543 - alexcrichton:old-io, r=aturon
In preparation for the I/O rejuvination of the standard library, this commit
renames the current `io` module to `old_io` in order to make room for the new
I/O modules. It is expected that the I/O RFCs will land incrementally over time
instead of all at once, and this provides a fresh clean path for new modules to
enter into as well as guaranteeing that all old infrastructure will remain in
place for some time.
As each `old_io` module is replaced it will be deprecated in-place for new
structures in `std::{io, fs, net}` (as appropriate).
This commit does *not* leave a reexport of `old_io as io` as the deprecation
lint does not currently warn on this form of use. This is quite a large breaking
change for all imports in existing code, but all functionality is retained
precisely as-is and path statements simply need to be renamed from `io` to
`old_io`.
[breaking-change]
Diffstat (limited to 'src/libstd/sys/common')
| -rw-r--r-- | src/libstd/sys/common/backtrace.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/common/mod.rs | 10 | ||||
| -rw-r--r-- | src/libstd/sys/common/net.rs | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/libstd/sys/common/backtrace.rs b/src/libstd/sys/common/backtrace.rs index d069d9ee3b8..9b53ebf70a0 100644 --- a/src/libstd/sys/common/backtrace.rs +++ b/src/libstd/sys/common/backtrace.rs @@ -10,7 +10,7 @@ use prelude::v1::*; -use io::IoResult; +use old_io::IoResult; #[cfg(target_pointer_width = "64")] pub const HEX_WIDTH: uint = 18; diff --git a/src/libstd/sys/common/mod.rs b/src/libstd/sys/common/mod.rs index 272cf9bd0c0..ae01586c703 100644 --- a/src/libstd/sys/common/mod.rs +++ b/src/libstd/sys/common/mod.rs @@ -11,7 +11,7 @@ #![allow(missing_docs)] #![allow(dead_code)] -use io::{self, IoError, IoResult}; +use old_io::{self, IoError, IoResult}; use prelude::v1::*; use sys::{last_error, retry}; use ffi::CString; @@ -35,7 +35,7 @@ pub mod wtf8; pub fn eof() -> IoError { IoError { - kind: io::EndOfFile, + kind: old_io::EndOfFile, desc: "end of file", detail: None, } @@ -43,7 +43,7 @@ pub fn eof() -> IoError { pub fn timeout(desc: &'static str) -> IoError { IoError { - kind: io::TimedOut, + kind: old_io::TimedOut, desc: desc, detail: None, } @@ -51,7 +51,7 @@ pub fn timeout(desc: &'static str) -> IoError { pub fn short_write(n: uint, desc: &'static str) -> IoError { IoError { - kind: if n == 0 { io::TimedOut } else { io::ShortWrite(n) }, + kind: if n == 0 { old_io::TimedOut } else { old_io::ShortWrite(n) }, desc: desc, detail: None, } @@ -59,7 +59,7 @@ pub fn short_write(n: uint, desc: &'static str) -> IoError { pub fn unimpl() -> IoError { IoError { - kind: io::IoUnavailable, + kind: old_io::IoUnavailable, desc: "operations not yet supported", detail: None, } diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index 4cf891ac498..e42db42dc60 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -14,9 +14,9 @@ use self::InAddr::*; use ffi::CString; use ffi; -use io::net::addrinfo; -use io::net::ip::{SocketAddr, IpAddr, Ipv4Addr, Ipv6Addr}; -use io::{IoResult, IoError}; +use old_io::net::addrinfo; +use old_io::net::ip::{SocketAddr, IpAddr, Ipv4Addr, Ipv6Addr}; +use old_io::{IoResult, IoError}; use libc::{self, c_char, c_int}; use mem; use num::Int; @@ -28,7 +28,7 @@ use sys::{self, retry, c, sock_t, last_error, last_net_error, last_gai_error, cl use sync::{Arc, Mutex, MutexGuard}; use sys_common::{self, keep_going, short_write, timeout}; use cmp; -use io; +use old_io; // FIXME: move uses of Arc and deadline tracking to std::io @@ -208,7 +208,7 @@ pub fn sockaddr_to_addr(storage: &libc::sockaddr_storage, } _ => { Err(IoError { - kind: io::InvalidInput, + kind: old_io::InvalidInput, desc: "invalid argument", detail: None, }) @@ -458,7 +458,7 @@ pub fn write<T, L, W>(fd: sock_t, // As with read(), first wait for the socket to be ready for // the I/O operation. match await(&[fd], deadline, Writable) { - Err(ref e) if e.kind == io::EndOfFile && written > 0 => { + Err(ref e) if e.kind == old_io::EndOfFile && written > 0 => { assert!(deadline.is_some()); return Err(short_write(written, "short write")) } |
