diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-22 16:31:00 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-26 16:01:16 -0800 |
| commit | 3a07f859b880bfe4dd6f095c959422d7c6b53831 (patch) | |
| tree | 797b16a0b4c63a16a37b098c577d47b537a8fbac /src/libstd | |
| parent | f72b1645103e12b581f7022b893c37b5fe41aef7 (diff) | |
| download | rust-3a07f859b880bfe4dd6f095c959422d7c6b53831.tar.gz rust-3a07f859b880bfe4dd6f095c959422d7c6b53831.zip | |
Fallout of io => old_io
Diffstat (limited to 'src/libstd')
34 files changed, 133 insertions, 133 deletions
diff --git a/src/libstd/failure.rs b/src/libstd/failure.rs index 54191cf2404..69c9a9200f7 100644 --- a/src/libstd/failure.rs +++ b/src/libstd/failure.rs @@ -14,12 +14,12 @@ use prelude::v1::*; use any::Any; use cell::RefCell; -use io::IoResult; +use old_io::IoResult; use rt::{backtrace, unwind}; use rt::util::{Stderr, Stdio}; use thread::Thread; -// Defined in this module instead of io::stdio so that the unwinding +// Defined in this module instead of old_io::stdio so that the unwinding thread_local! { pub static LOCAL_STDERR: RefCell<Option<Box<Writer + Send>>> = { RefCell::new(None) diff --git a/src/libstd/fmt.rs b/src/libstd/fmt.rs index f3b159cf819..5965a0ceffb 100644 --- a/src/libstd/fmt.rs +++ b/src/libstd/fmt.rs @@ -238,7 +238,7 @@ //! //! ```ignore //! format! // described above -//! write! // first argument is a &mut io::Writer, the destination +//! write! // first argument is a &mut old_io::Writer, the destination //! writeln! // same as write but appends a newline //! print! // the format string is printed to the standard output //! println! // same as print but appends a newline @@ -255,10 +255,8 @@ //! //! ```rust //! # #![allow(unused_must_use)] -//! use std::io; -//! //! let mut w = Vec::new(); -//! write!(&mut w as &mut io::Writer, "Hello {}!", "world"); +//! write!(&mut w, "Hello {}!", "world"); //! ``` //! //! #### `print!` @@ -282,15 +280,15 @@ //! //! ``` //! use std::fmt; -//! use std::io; +//! use std::old_io; //! //! fmt::format(format_args!("this returns {}", "String")); //! -//! let some_writer: &mut io::Writer = &mut io::stdout(); -//! write!(some_writer, "{}", format_args!("print with a {}", "macro")); +//! let mut some_writer = old_io::stdout(); +//! write!(&mut some_writer, "{}", format_args!("print with a {}", "macro")); //! //! fn my_fmt_fn(args: fmt::Arguments) { -//! write!(&mut io::stdout(), "{}", args); +//! write!(&mut old_io::stdout(), "{}", args); //! } //! my_fmt_fn(format_args!("or a {} too", "function")); //! ``` diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 8a8d14c4f3a..9f0276c744b 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -81,14 +81,14 @@ macro_rules! format { #[macro_export] #[stable] macro_rules! print { - ($($arg:tt)*) => ($crate::io::stdio::print_args(format_args!($($arg)*))) + ($($arg:tt)*) => ($crate::old_io::stdio::print_args(format_args!($($arg)*))) } /// Macro for printing to a task's stdout handle. /// -/// Each task can override its stdout handle via `std::io::stdio::set_stdout`. +/// Each task can override its stdout handle via `std::old_io::stdio::set_stdout`. /// The syntax of this macro is the same as that used for `format!`. For more -/// information, see `std::fmt` and `std::io::stdio`. +/// information, see `std::fmt` and `std::old_io::stdio`. /// /// # Example /// @@ -99,7 +99,7 @@ macro_rules! print { #[macro_export] #[stable] macro_rules! println { - ($($arg:tt)*) => ($crate::io::stdio::println_args(format_args!($($arg)*))) + ($($arg:tt)*) => ($crate::old_io::stdio::println_args(format_args!($($arg)*))) } /// Helper macro for unwrapping `Result` values while returning early with an diff --git a/src/libstd/old_io/buffered.rs b/src/libstd/old_io/buffered.rs index c04af865af8..fc2eb10ec16 100644 --- a/src/libstd/old_io/buffered.rs +++ b/src/libstd/old_io/buffered.rs @@ -423,7 +423,7 @@ impl<S: Stream> Writer for BufferedStream<S> { #[cfg(test)] mod test { extern crate test; - use io; + use old_io; use prelude::v1::*; use super::*; use super::super::{IoResult, EndOfFile}; diff --git a/src/libstd/old_io/comm_adapters.rs b/src/libstd/old_io/comm_adapters.rs index 3c684e4cc6a..bca023b338f 100644 --- a/src/libstd/old_io/comm_adapters.rs +++ b/src/libstd/old_io/comm_adapters.rs @@ -160,7 +160,7 @@ mod test { use sync::mpsc::channel; use super::*; - use io; + use old_io; use thread::Thread; #[test] diff --git a/src/libstd/old_io/extensions.rs b/src/libstd/old_io/extensions.rs index 259242d0cd8..826271a9f83 100644 --- a/src/libstd/old_io/extensions.rs +++ b/src/libstd/old_io/extensions.rs @@ -178,7 +178,7 @@ pub fn u64_from_be_bytes(data: &[u8], start: uint, size: uint) -> u64 { #[cfg(test)] mod test { use prelude::v1::*; - use io; + use old_io; use old_io::{MemReader, BytesReader}; struct InitialZeroByteReader { diff --git a/src/libstd/old_io/fs.rs b/src/libstd/old_io/fs.rs index ee6dbafe688..3a39ffc9494 100644 --- a/src/libstd/old_io/fs.rs +++ b/src/libstd/old_io/fs.rs @@ -407,7 +407,7 @@ pub fn copy(from: &Path, to: &Path) -> IoResult<()> { /// /// ```rust /// # #![allow(unused_must_use)] -/// use std::io; +/// use std::old_io; /// use std::old_io::fs; /// /// fs::chmod(&Path::new("file.txt"), old_io::USER_FILE); @@ -469,7 +469,7 @@ pub fn readlink(path: &Path) -> IoResult<Path> { /// /// ```rust /// # #![allow(unused_must_use)] -/// use std::io; +/// use std::old_io; /// use std::old_io::fs; /// /// let p = Path::new("/some/dir"); @@ -515,7 +515,7 @@ pub fn rmdir(path: &Path) -> IoResult<()> { /// ```rust /// use std::old_io::fs::PathExtensions; /// use std::old_io::fs; -/// use std::io; +/// use std::old_io; /// /// // one possible implementation of fs::walk_dir only visiting files /// fn visit_dirs<F>(dir: &Path, cb: &mut F) -> old_io::IoResult<()> where @@ -825,7 +825,7 @@ fn access_string(access: FileAccess) -> &'static str { mod test { use prelude::v1::*; use old_io::{SeekSet, SeekCur, SeekEnd, Read, Open, ReadWrite, FileType}; - use io; + use old_io; use str; use old_io::fs::*; diff --git a/src/libstd/old_io/mem.rs b/src/libstd/old_io/mem.rs index 3fc2a330fde..5f8d2aa76ce 100644 --- a/src/libstd/old_io/mem.rs +++ b/src/libstd/old_io/mem.rs @@ -393,7 +393,7 @@ mod test { use old_io::{SeekSet, SeekCur, SeekEnd, Reader, Writer, Seek}; use prelude::v1::{Ok, Err, range, Vec, Buffer, AsSlice, SliceExt}; use prelude::v1::IteratorExt; - use io; + use old_io; use iter::repeat; use self::test_crate::Bencher; use super::*; diff --git a/src/libstd/old_io/result.rs b/src/libstd/old_io/result.rs index c1474650f1e..60631287b08 100644 --- a/src/libstd/old_io/result.rs +++ b/src/libstd/old_io/result.rs @@ -80,11 +80,11 @@ impl<T, A: Acceptor<T>> Acceptor<T> for IoResult<A> { mod test { use prelude::v1::*; use super::super::mem::*; - use io; + use old_io; #[test] fn test_option_writer() { - let mut writer: io::IoResult<Vec<u8>> = Ok(Vec::new()); + let mut writer: old_io::IoResult<Vec<u8>> = Ok(Vec::new()); writer.write(&[0, 1, 2]).unwrap(); writer.flush().unwrap(); assert_eq!(writer.unwrap(), vec!(0, 1, 2)); @@ -92,22 +92,22 @@ mod test { #[test] fn test_option_writer_error() { - let mut writer: io::IoResult<Vec<u8>> = - Err(io::standard_error(io::EndOfFile)); + let mut writer: old_io::IoResult<Vec<u8>> = + Err(old_io::standard_error(old_io::EndOfFile)); match writer.write(&[0, 0, 0]) { Ok(..) => panic!(), - Err(e) => assert_eq!(e.kind, io::EndOfFile), + Err(e) => assert_eq!(e.kind, old_io::EndOfFile), } match writer.flush() { Ok(..) => panic!(), - Err(e) => assert_eq!(e.kind, io::EndOfFile), + Err(e) => assert_eq!(e.kind, old_io::EndOfFile), } } #[test] fn test_option_reader() { - let mut reader: io::IoResult<MemReader> = + let mut reader: old_io::IoResult<MemReader> = Ok(MemReader::new(vec!(0, 1, 2, 3))); let mut buf = [0, 0]; reader.read(&mut buf).unwrap(); @@ -117,13 +117,13 @@ mod test { #[test] fn test_option_reader_error() { - let mut reader: io::IoResult<MemReader> = - Err(io::standard_error(io::EndOfFile)); + let mut reader: old_io::IoResult<MemReader> = + Err(old_io::standard_error(old_io::EndOfFile)); let mut buf = []; match reader.read(&mut buf) { Ok(..) => panic!(), - Err(e) => assert_eq!(e.kind, io::EndOfFile), + Err(e) => assert_eq!(e.kind, old_io::EndOfFile), } } } diff --git a/src/libstd/old_io/stdio.rs b/src/libstd/old_io/stdio.rs index 04eedc758cd..81068aca6c2 100644 --- a/src/libstd/old_io/stdio.rs +++ b/src/libstd/old_io/stdio.rs @@ -19,7 +19,7 @@ //! //! ```rust //! # #![allow(unused_must_use)] -//! use std::io; +//! use std::old_io; //! //! let mut out = old_io::stdout(); //! out.write(b"Hello, world!"); @@ -141,7 +141,7 @@ impl StdinReader { /// # Examples /// /// ```rust - /// use std::io; + /// use std::old_io; /// /// for line in old_io::stdin().lock().lines() { /// println!("{}", line.unwrap()); diff --git a/src/libstd/old_io/util.rs b/src/libstd/old_io/util.rs index f3f0b8dd663..c8a929b3a0d 100644 --- a/src/libstd/old_io/util.rs +++ b/src/libstd/old_io/util.rs @@ -276,7 +276,7 @@ mod test { use prelude::v1::*; use old_io::{MemReader, ByRefReader}; - use io; + use old_io; use super::*; #[test] diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 985a8cd32e2..f041d2799ab 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -10,17 +10,19 @@ //! Higher-level interfaces to libc::* functions and operating system services. //! -//! In general these take and return rust types, use rust idioms (enums, closures, vectors) rather -//! than C idioms, and do more extensive safety checks. +//! In general these take and return rust types, use rust idioms (enums, +//! closures, vectors) rather than C idioms, and do more extensive safety +//! checks. //! -//! This module is not meant to only contain 1:1 mappings to libc entries; any os-interface code -//! that is reasonably useful and broadly applicable can go here. Including utility routines that -//! merely build on other os code. +//! This module is not meant to only contain 1:1 mappings to libc entries; any +//! os-interface code that is reasonably useful and broadly applicable can go +//! here. Including utility routines that merely build on other os code. //! -//! We assume the general case is that users do not care, and do not want to be made to care, which -//! operating system they are on. While they may want to special case various special cases -- and -//! so we will not _hide_ the facts of which OS the user is on -- they should be given the -//! opportunity to write OS-ignorant code by default. +//! We assume the general case is that users do not care, and do not want to be +//! made to care, which operating system they are on. While they may want to +//! special case various special cases -- and so we will not _hide_ the facts of +//! which OS the user is on -- they should be given the opportunity to write +//! OS-ignorant code by default. #![unstable] @@ -35,7 +37,7 @@ use self::MapError::*; use clone::Clone; use error::{FromError, Error}; use fmt; -use io::{IoResult, IoError}; +use old_io::{IoResult, IoError}; use iter::{Iterator, IteratorExt}; use marker::{Copy, Send}; use libc::{c_void, c_int, c_char}; @@ -374,7 +376,7 @@ pub struct Pipe { /// This function is also unsafe as there is no destructor associated with the /// `Pipe` structure will return. If it is not arranged for the returned file /// descriptors to be closed, the file descriptors will leak. For safe handling -/// of this scenario, use `std::io::PipeStream` instead. +/// of this scenario, use `std::old_io::PipeStream` instead. pub unsafe fn pipe() -> IoResult<Pipe> { let (reader, writer) = try!(sys::os::pipe()); Ok(Pipe { @@ -1635,10 +1637,10 @@ mod tests { fn memory_map_file() { use libc; use os::*; - use io::fs::{File, unlink}; - use io::SeekStyle::SeekSet; - use io::FileMode::Open; - use io::FileAccess::ReadWrite; + use old_io::fs::{File, unlink}; + use old_io::SeekStyle::SeekSet; + use old_io::FileMode::Open; + use old_io::FileAccess::ReadWrite; #[cfg(not(windows))] fn get_fd(file: &File) -> libc::c_int { diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index 06d930ce50a..1b09fb92737 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -49,7 +49,7 @@ //! ## Example //! //! ```rust -//! use std::io::fs::PathExtensions; +//! use std::old_io::fs::PathExtensions; //! //! let mut path = Path::new("/tmp/path"); //! println!("path: {}", path.display()); diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index 100876271b3..202d81f5696 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -14,7 +14,7 @@ use clone::Clone; use cmp::{Ordering, Eq, Ord, PartialEq, PartialOrd}; use fmt; use hash; -use io::Writer; +use old_io::Writer; use iter::{AdditiveIterator, Extend}; use iter::{Iterator, IteratorExt, Map}; use marker::Sized; diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index bd5f8416577..9f5ed177918 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -20,7 +20,7 @@ use clone::Clone; use cmp::{Ordering, Eq, Ord, PartialEq, PartialOrd}; use fmt; use hash; -use io::Writer; +use old_io::Writer; use iter::{AdditiveIterator, Extend}; use iter::{Iterator, IteratorExt, Map, repeat}; use mem; diff --git a/src/libstd/prelude/v1.rs b/src/libstd/prelude/v1.rs index d9c942c0185..aa4db7b6b70 100644 --- a/src/libstd/prelude/v1.rs +++ b/src/libstd/prelude/v1.rs @@ -43,6 +43,6 @@ // NB: remove when path reform lands #[doc(no_inline)] pub use path::{Path, GenericPath}; // NB: remove when I/O reform lands -#[doc(no_inline)] pub use io::{Buffer, Writer, Reader, Seek, BufferPrelude}; +#[doc(no_inline)] pub use old_io::{Buffer, Writer, Reader, Seek, BufferPrelude}; // NB: remove when range syntax lands #[doc(no_inline)] pub use iter::range; diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index 23387d29553..ac87fc11a34 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -223,7 +223,7 @@ use cell::RefCell; use clone::Clone; -use io::IoResult; +use old_io::IoResult; use iter::{Iterator, IteratorExt}; use mem; use rc::Rc; diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index bafbde2511d..547c8131486 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -19,7 +19,7 @@ mod imp { use self::OsRngInner::*; - use io::{IoResult, File}; + use old_io::{IoResult, File}; use path::Path; use rand::Rng; use rand::reader::ReaderRng; @@ -187,7 +187,7 @@ mod imp { mod imp { extern crate libc; - use io::{IoResult}; + use old_io::{IoResult}; use marker::Sync; use mem; use os; @@ -259,7 +259,7 @@ mod imp { mod imp { extern crate libc; - use io::{IoResult, IoError}; + use old_io::{IoResult, IoError}; use mem; use ops::Drop; use os; diff --git a/src/libstd/rand/reader.rs b/src/libstd/rand/reader.rs index 177b7380831..afacfeeaa30 100644 --- a/src/libstd/rand/reader.rs +++ b/src/libstd/rand/reader.rs @@ -10,7 +10,7 @@ //! A wrapper around any Reader to treat it as an RNG. -use io::Reader; +use old_io::Reader; use rand::Rng; use result::Result::{Ok, Err}; use slice::SliceExt; @@ -26,7 +26,7 @@ use slice::SliceExt; /// /// ```rust /// use std::rand::{reader, Rng}; -/// use std::io::MemReader; +/// use std::old_io::MemReader; /// /// let mut rng = reader::ReaderRng::new(MemReader::new(vec!(1,2,3,4,5,6,7,8))); /// println!("{:x}", rng.gen::<uint>()); @@ -77,7 +77,7 @@ mod test { use prelude::v1::*; use super::ReaderRng; - use io::MemReader; + use old_io::MemReader; use num::Int; use rand::Rng; diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 893f353b1a7..6140e3fd36c 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -120,7 +120,7 @@ //! //! ```no_run //! use std::sync::mpsc::channel; -//! use std::io::timer::Timer; +//! use std::old_io::timer::Timer; //! use std::time::Duration; //! //! let (tx, rx) = channel::<int>(); @@ -144,7 +144,7 @@ //! //! ```no_run //! use std::sync::mpsc::channel; -//! use std::io::timer::Timer; +//! use std::old_io::timer::Timer; //! use std::time::Duration; //! //! let (tx, rx) = channel::<int>(); 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")) } diff --git a/src/libstd/sys/unix/backtrace.rs b/src/libstd/sys/unix/backtrace.rs index cb2edf50ebd..65f1b5e9883 100644 --- a/src/libstd/sys/unix/backtrace.rs +++ b/src/libstd/sys/unix/backtrace.rs @@ -86,7 +86,7 @@ use prelude::v1::*; use ffi; -use io::IoResult; +use old_io::IoResult; use libc; use mem; use str; @@ -136,7 +136,7 @@ pub fn write(w: &mut Writer) -> IoResult<()> { #[inline(never)] // if we know this is a function call, we can skip it when // tracing pub fn write(w: &mut Writer) -> IoResult<()> { - use io::IoError; + use old_io::IoError; struct Context<'a> { idx: int, diff --git a/src/libstd/sys/unix/ext.rs b/src/libstd/sys/unix/ext.rs index 9c659b56d93..37c47d593e0 100644 --- a/src/libstd/sys/unix/ext.rs +++ b/src/libstd/sys/unix/ext.rs @@ -18,7 +18,7 @@ //! ```rust,ignore //! #![feature(globs)] //! -//! use std::io::fs::File; +//! use std::old_io::fs::File; //! use std::os::unix::prelude::*; //! //! fn main() { @@ -37,7 +37,7 @@ use sys_common::{AsInner, IntoInner, FromInner}; use ffi::{OsStr, OsString}; use libc; -use io; +use old_io; /// Raw file descriptors. pub type Fd = libc::c_int; @@ -48,55 +48,55 @@ pub trait AsRawFd { fn as_raw_fd(&self) -> Fd; } -impl AsRawFd for io::fs::File { +impl AsRawFd for old_io::fs::File { fn as_raw_fd(&self) -> Fd { self.as_inner().fd() } } -impl AsRawFd for io::pipe::PipeStream { +impl AsRawFd for old_io::pipe::PipeStream { fn as_raw_fd(&self) -> Fd { self.as_inner().fd() } } -impl AsRawFd for io::net::pipe::UnixStream { +impl AsRawFd for old_io::net::pipe::UnixStream { fn as_raw_fd(&self) -> Fd { self.as_inner().fd() } } -impl AsRawFd for io::net::pipe::UnixListener { +impl AsRawFd for old_io::net::pipe::UnixListener { fn as_raw_fd(&self) -> Fd { self.as_inner().fd() } } -impl AsRawFd for io::net::pipe::UnixAcceptor { +impl AsRawFd for old_io::net::pipe::UnixAcceptor { fn as_raw_fd(&self) -> Fd { self.as_inner().fd() } } -impl AsRawFd for io::net::tcp::TcpStream { +impl AsRawFd for old_io::net::tcp::TcpStream { fn as_raw_fd(&self) -> Fd { self.as_inner().fd() } } -impl AsRawFd for io::net::tcp::TcpListener { +impl AsRawFd for old_io::net::tcp::TcpListener { fn as_raw_fd(&self) -> Fd { self.as_inner().fd() } } -impl AsRawFd for io::net::tcp::TcpAcceptor { +impl AsRawFd for old_io::net::tcp::TcpAcceptor { fn as_raw_fd(&self) -> Fd { self.as_inner().fd() } } -impl AsRawFd for io::net::udp::UdpSocket { +impl AsRawFd for old_io::net::udp::UdpSocket { fn as_raw_fd(&self) -> Fd { self.as_inner().fd() } diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index dd478347f81..66ae018cb36 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -13,10 +13,10 @@ use prelude::v1::*; use ffi::{self, CString}; -use io::{FilePermission, Write, UnstableFileStat, Open, FileAccess, FileMode}; -use io::{IoResult, FileStat, SeekStyle}; -use io::{Read, Truncate, SeekCur, SeekSet, ReadWrite, SeekEnd, Append}; -use io; +use old_io::{FilePermission, Write, UnstableFileStat, Open, FileAccess, FileMode}; +use old_io::{IoResult, FileStat, SeekStyle}; +use old_io::{Read, Truncate, SeekCur, SeekSet, ReadWrite, SeekEnd, Append}; +use old_io; use libc::{self, c_int, c_void}; use mem; use ptr; @@ -304,12 +304,12 @@ fn mkstat(stat: &libc::stat) -> FileStat { FileStat { size: stat.st_size as u64, kind: match (stat.st_mode as libc::mode_t) & libc::S_IFMT { - libc::S_IFREG => io::FileType::RegularFile, - libc::S_IFDIR => io::FileType::Directory, - libc::S_IFIFO => io::FileType::NamedPipe, - libc::S_IFBLK => io::FileType::BlockSpecial, - libc::S_IFLNK => io::FileType::Symlink, - _ => io::FileType::Unknown, + libc::S_IFREG => old_io::FileType::RegularFile, + libc::S_IFDIR => old_io::FileType::Directory, + libc::S_IFIFO => old_io::FileType::NamedPipe, + libc::S_IFBLK => old_io::FileType::BlockSpecial, + libc::S_IFLNK => old_io::FileType::Symlink, + _ => old_io::FileType::Unknown, }, perm: FilePermission::from_bits_truncate(stat.st_mode as u32), created: mktime(stat.st_ctime as u64, stat.st_ctime_nsec as u64), diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs index 5493bc20a87..f2f2e7436bf 100644 --- a/src/libstd/sys/unix/mod.rs +++ b/src/libstd/sys/unix/mod.rs @@ -18,7 +18,7 @@ use prelude::v1::*; use ffi; -use io::{self, IoResult, IoError}; +use old_io::{self, IoResult, IoError}; use libc; use num::{Int, SignedInt}; use num; @@ -94,35 +94,35 @@ pub fn last_gai_error(s: libc::c_int) -> IoError { pub fn decode_error(errno: i32) -> IoError { // FIXME: this should probably be a bit more descriptive... let (kind, desc) = match errno { - libc::EOF => (io::EndOfFile, "end of file"), - libc::ECONNREFUSED => (io::ConnectionRefused, "connection refused"), - libc::ECONNRESET => (io::ConnectionReset, "connection reset"), + libc::EOF => (old_io::EndOfFile, "end of file"), + libc::ECONNREFUSED => (old_io::ConnectionRefused, "connection refused"), + libc::ECONNRESET => (old_io::ConnectionReset, "connection reset"), libc::EPERM | libc::EACCES => - (io::PermissionDenied, "permission denied"), - libc::EPIPE => (io::BrokenPipe, "broken pipe"), - libc::ENOTCONN => (io::NotConnected, "not connected"), - libc::ECONNABORTED => (io::ConnectionAborted, "connection aborted"), - libc::EADDRNOTAVAIL => (io::ConnectionRefused, "address not available"), - libc::EADDRINUSE => (io::ConnectionRefused, "address in use"), - libc::ENOENT => (io::FileNotFound, "no such file or directory"), - libc::EISDIR => (io::InvalidInput, "illegal operation on a directory"), - libc::ENOSYS => (io::IoUnavailable, "function not implemented"), - libc::EINVAL => (io::InvalidInput, "invalid argument"), + (old_io::PermissionDenied, "permission denied"), + libc::EPIPE => (old_io::BrokenPipe, "broken pipe"), + libc::ENOTCONN => (old_io::NotConnected, "not connected"), + libc::ECONNABORTED => (old_io::ConnectionAborted, "connection aborted"), + libc::EADDRNOTAVAIL => (old_io::ConnectionRefused, "address not available"), + libc::EADDRINUSE => (old_io::ConnectionRefused, "address in use"), + libc::ENOENT => (old_io::FileNotFound, "no such file or directory"), + libc::EISDIR => (old_io::InvalidInput, "illegal operation on a directory"), + libc::ENOSYS => (old_io::IoUnavailable, "function not implemented"), + libc::EINVAL => (old_io::InvalidInput, "invalid argument"), libc::ENOTTY => - (io::MismatchedFileTypeForOperation, + (old_io::MismatchedFileTypeForOperation, "file descriptor is not a TTY"), - libc::ETIMEDOUT => (io::TimedOut, "operation timed out"), - libc::ECANCELED => (io::TimedOut, "operation aborted"), + libc::ETIMEDOUT => (old_io::TimedOut, "operation timed out"), + libc::ECANCELED => (old_io::TimedOut, "operation aborted"), libc::consts::os::posix88::EEXIST => - (io::PathAlreadyExists, "path already exists"), + (old_io::PathAlreadyExists, "path already exists"), // These two constants can have the same value on some systems, // but different values on others, so we can't use a match // clause x if x == libc::EAGAIN || x == libc::EWOULDBLOCK => - (io::ResourceUnavailable, "resource temporarily unavailable"), + (old_io::ResourceUnavailable, "resource temporarily unavailable"), - _ => (io::OtherIoError, "unknown error") + _ => (old_io::OtherIoError, "unknown error") }; IoError { kind: kind, desc: desc, detail: None } } diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index 2c25af055ee..5d5cda03f01 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -15,7 +15,7 @@ use prelude::v1::*; use error::{FromError, Error}; use ffi::{self, CString}; use fmt; -use io::{IoError, IoResult}; +use old_io::{IoError, IoResult}; use libc::{self, c_int, c_char, c_void}; use os::TMPBUF_SZ; use os; @@ -198,7 +198,7 @@ pub fn load_self() -> Option<Vec<u8>> { pub fn load_self() -> Option<Vec<u8>> { use std::io; - match io::fs::readlink(&Path::new("/proc/curproc/file")) { + match old_io::fs::readlink(&Path::new("/proc/curproc/file")) { Ok(path) => Some(path.into_vec()), Err(..) => None } @@ -206,9 +206,9 @@ pub fn load_self() -> Option<Vec<u8>> { #[cfg(any(target_os = "linux", target_os = "android"))] pub fn load_self() -> Option<Vec<u8>> { - use std::io; + use old_io; - match io::fs::readlink(&Path::new("/proc/self/exe")) { + match old_io::fs::readlink(&Path::new("/proc/self/exe")) { Ok(path) => Some(path.into_vec()), Err(..) => None } diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs index 158a1ce2204..16274a2ab08 100644 --- a/src/libstd/sys/unix/pipe.rs +++ b/src/libstd/sys/unix/pipe.rs @@ -15,7 +15,7 @@ use libc; use mem; use sync::{Arc, Mutex}; use sync::atomic::{AtomicBool, Ordering}; -use io::{self, IoResult, IoError}; +use old_io::{self, IoResult, IoError}; use sys::{self, timer, retry, c, set_nonblocking, wouldblock}; use sys::fs::{fd_t, FileDesc}; @@ -41,7 +41,7 @@ fn addr_to_sockaddr_un(addr: &CString, let len = addr.len(); if len > s.sun_path.len() - 1 { return Err(IoError { - kind: io::InvalidInput, + kind: old_io::InvalidInput, desc: "invalid argument: path must be smaller than SUN_LEN", detail: None, }) diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index 2b4d168d881..6e12432649f 100644 --- a/src/libstd/sys/unix/process.rs +++ b/src/libstd/sys/unix/process.rs @@ -15,8 +15,8 @@ use collections::HashMap; use collections::hash_map::Hasher; use ffi::CString; use hash::Hash; -use io::process::{ProcessExit, ExitStatus, ExitSignal}; -use io::{self, IoResult, IoError, EndOfFile}; +use old_io::process::{ProcessExit, ExitStatus, ExitSignal}; +use old_io::{self, IoResult, IoError, EndOfFile}; use libc::{self, pid_t, c_void, c_int}; use mem; use os; diff --git a/src/libstd/sys/unix/tcp.rs b/src/libstd/sys/unix/tcp.rs index 59eebd3f28e..c8f9d318482 100644 --- a/src/libstd/sys/unix/tcp.rs +++ b/src/libstd/sys/unix/tcp.rs @@ -10,8 +10,8 @@ use prelude::v1::*; -use io::net::ip; -use io::IoResult; +use old_io::net::ip; +use old_io::IoResult; use libc; use mem; use ptr; diff --git a/src/libstd/sys/unix/timer.rs b/src/libstd/sys/unix/timer.rs index c0c231a9e73..6a4e47f58ce 100644 --- a/src/libstd/sys/unix/timer.rs +++ b/src/libstd/sys/unix/timer.rs @@ -49,7 +49,7 @@ use prelude::v1::*; use self::Req::*; -use io::IoResult; +use old_io::IoResult; use libc; use mem; use os; diff --git a/src/libstd/sys/unix/tty.rs b/src/libstd/sys/unix/tty.rs index d20469f5106..2df1b1968f1 100644 --- a/src/libstd/sys/unix/tty.rs +++ b/src/libstd/sys/unix/tty.rs @@ -12,7 +12,7 @@ use prelude::v1::*; use sys::fs::FileDesc; use libc::{self, c_int, c_ulong, funcs}; -use io::{self, IoResult, IoError}; +use old_io::{self, IoResult, IoError}; use sys::c; use sys_common; @@ -33,7 +33,7 @@ impl TTY { Ok(TTY { fd: FileDesc::new(fd, true) }) } else { Err(IoError { - kind: io::MismatchedFileTypeForOperation, + kind: old_io::MismatchedFileTypeForOperation, desc: "file descriptor is not a TTY", detail: None, }) diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index a86b82b8c62..4d932b3e777 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -158,7 +158,7 @@ use sync::{Mutex, Condvar, Arc}; use str::Str; use string::String; use rt::{self, unwind}; -use io::{Writer, stdio}; +use old_io::{Writer, stdio}; use thunk::Thunk; use sys::thread as imp; @@ -508,7 +508,7 @@ mod test { use sync::mpsc::{channel, Sender}; use boxed::BoxAny; use result; - use std::io::{ChanReader, ChanWriter}; + use std::old_io::{ChanReader, ChanWriter}; use super::{Thread, Builder}; use thunk::Thunk; |
