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]
This commit is contained in:
commit
a6a6fadbb9
188 changed files with 1141 additions and 1116 deletions
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#![feature(unboxed_closures)]
|
||||
|
||||
use std::io::File;
|
||||
use std::old_io::File;
|
||||
use std::iter::repeat;
|
||||
use std::mem::swap;
|
||||
use std::os;
|
||||
|
|
@ -71,7 +71,7 @@ fn shift_push() {
|
|||
}
|
||||
|
||||
fn read_line() {
|
||||
use std::io::BufferedReader;
|
||||
use std::old_io::BufferedReader;
|
||||
|
||||
let mut path = Path::new(env!("CFG_SRC_DIR"));
|
||||
path.push("src/test/bench/shootout-k-nucleotide.data");
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
use std::cmp::min;
|
||||
use std::io::{stdout, IoResult};
|
||||
use std::old_io::{stdout, IoResult};
|
||||
use std::iter::repeat;
|
||||
use std::os;
|
||||
use std::slice::bytes::copy_memory;
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@
|
|||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
use std::cmp::min;
|
||||
use std::io::{BufferedWriter, File};
|
||||
use std::io;
|
||||
use std::old_io::{BufferedWriter, File};
|
||||
use std::old_io;
|
||||
use std::num::Float;
|
||||
use std::os;
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ impl<'a> Iterator for AAGen<'a> {
|
|||
|
||||
fn make_fasta<W: Writer, I: Iterator<Item=u8>>(
|
||||
wr: &mut W, header: &str, mut it: I, mut n: uint)
|
||||
-> std::io::IoResult<()>
|
||||
-> std::old_io::IoResult<()>
|
||||
{
|
||||
try!(wr.write(header.as_bytes()));
|
||||
let mut line = [0u8; LINE_LENGTH + 1];
|
||||
|
|
@ -102,7 +102,7 @@ fn make_fasta<W: Writer, I: Iterator<Item=u8>>(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn run<W: Writer>(writer: &mut W) -> std::io::IoResult<()> {
|
||||
fn run<W: Writer>(writer: &mut W) -> std::old_io::IoResult<()> {
|
||||
let args = os::args();
|
||||
let args = args.as_slice();
|
||||
let n = if os::getenv("RUST_BENCH").is_some() {
|
||||
|
|
@ -147,7 +147,7 @@ fn main() {
|
|||
let mut file = BufferedWriter::new(File::create(&Path::new("./shootout-fasta.data")));
|
||||
run(&mut file)
|
||||
} else {
|
||||
run(&mut io::stdout())
|
||||
run(&mut old_io::stdout())
|
||||
};
|
||||
res.unwrap()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ fn make_sequence_processor(sz: uint,
|
|||
|
||||
// given a FASTA file on stdin, process sequence THREE
|
||||
fn main() {
|
||||
use std::io::{stdio, MemReader, BufferedReader};
|
||||
use std::old_io::{stdio, MemReader, BufferedReader};
|
||||
|
||||
let rdr = if os::getenv("RUST_BENCH").is_some() {
|
||||
let foo = include_bytes!("shootout-k-nucleotide.data");
|
||||
|
|
|
|||
|
|
@ -294,10 +294,10 @@ fn get_sequence<R: Buffer>(r: &mut R, key: &str) -> Vec<u8> {
|
|||
|
||||
fn main() {
|
||||
let input = if std::os::getenv("RUST_BENCH").is_some() {
|
||||
let fd = std::io::File::open(&Path::new("shootout-k-nucleotide.data"));
|
||||
get_sequence(&mut std::io::BufferedReader::new(fd), ">THREE")
|
||||
let fd = std::old_io::File::open(&Path::new("shootout-k-nucleotide.data"));
|
||||
get_sequence(&mut std::old_io::BufferedReader::new(fd), ">THREE")
|
||||
} else {
|
||||
get_sequence(&mut *std::io::stdin().lock(), ">THREE")
|
||||
get_sequence(&mut *std::old_io::stdin().lock(), ">THREE")
|
||||
};
|
||||
let input = Arc::new(input);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
// ignore-pretty very bad with line comments
|
||||
|
||||
use std::io;
|
||||
use std::old_io;
|
||||
use std::os;
|
||||
use std::simd::f64x2;
|
||||
use std::sync::Arc;
|
||||
|
|
@ -54,7 +54,7 @@ const LIMIT: f64 = 2.0;
|
|||
const WORKERS: uint = 16;
|
||||
|
||||
#[inline(always)]
|
||||
fn mandelbrot<W: io::Writer>(w: uint, mut out: W) -> io::IoResult<()> {
|
||||
fn mandelbrot<W: old_io::Writer>(w: uint, mut out: W) -> old_io::IoResult<()> {
|
||||
assert!(WORKERS % 2 == 0);
|
||||
|
||||
// Ensure w and h are multiples of 8.
|
||||
|
|
@ -203,9 +203,9 @@ fn main() {
|
|||
let res = if args.len() < 2 {
|
||||
println!("Test mode: do not dump the image because it's not utf8, \
|
||||
which interferes with the test runner.");
|
||||
mandelbrot(1000, io::util::NullWriter)
|
||||
mandelbrot(1000, old_io::util::NullWriter)
|
||||
} else {
|
||||
mandelbrot(args[1].parse().unwrap(), io::stdout())
|
||||
mandelbrot(args[1].parse().unwrap(), old_io::stdout())
|
||||
};
|
||||
res.unwrap();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@
|
|||
|
||||
extern crate libc;
|
||||
|
||||
use std::io::stdio::{stdin_raw, stdout_raw};
|
||||
use std::io::{IoResult, EndOfFile};
|
||||
use std::old_io::stdio::{stdin_raw, stdout_raw};
|
||||
use std::old_io::{IoResult, EndOfFile};
|
||||
use std::ptr::{copy_memory, Unique};
|
||||
use std::thread::Thread;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
#![feature(box_syntax)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
use std::io::BufferedReader;
|
||||
use std::io::stdio::StdReader;
|
||||
use std::io;
|
||||
use std::old_io::BufferedReader;
|
||||
use std::old_io::stdio::StdReader;
|
||||
use std::old_io;
|
||||
use std::iter::repeat;
|
||||
use std::num::Int;
|
||||
use std::os;
|
||||
|
|
@ -80,7 +80,7 @@ impl Sudoku {
|
|||
return Sudoku::new(g)
|
||||
}
|
||||
|
||||
pub fn write(&self, writer: &mut io::Writer) {
|
||||
pub fn write(&self, writer: &mut old_io::Writer) {
|
||||
for row in range(0u8, 9u8) {
|
||||
write!(writer, "{}", self.grid[row as uint][0]);
|
||||
for col in range(1u8, 9u8) {
|
||||
|
|
@ -274,8 +274,8 @@ fn main() {
|
|||
let mut sudoku = if use_default {
|
||||
Sudoku::from_vec(&DEFAULT_SUDOKU)
|
||||
} else {
|
||||
Sudoku::read(&mut *io::stdin().lock())
|
||||
Sudoku::read(&mut *old_io::stdin().lock())
|
||||
};
|
||||
sudoku.solve();
|
||||
sudoku.write(&mut io::stdout());
|
||||
sudoku.write(&mut old_io::stdout());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ fn main() {
|
|||
move|:| { x = 2; };
|
||||
//~^ ERROR: cannot assign to immutable captured outer variable
|
||||
|
||||
let s = std::io::stdin();
|
||||
let s = std::old_io::stdin();
|
||||
move|:| { s.read_to_end(); };
|
||||
//~^ ERROR: cannot borrow immutable captured outer variable
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io;
|
||||
use std::old_io;
|
||||
use std::vec;
|
||||
|
||||
pub struct Container<'a> {
|
||||
|
|
@ -26,7 +26,7 @@ impl<'a> Container<'a> {
|
|||
}
|
||||
|
||||
pub fn for_stdin<'a>() -> Container<'a> {
|
||||
let mut r = io::stdin();
|
||||
let mut r = old_io::stdin();
|
||||
Container::wrap(&mut r as &mut Reader)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@
|
|||
#![allow(unstable)]
|
||||
#![deny(non_snake_case)]
|
||||
|
||||
use std::io::File;
|
||||
use std::io::IoError;
|
||||
use std::old_io::File;
|
||||
use std::old_io::IoError;
|
||||
|
||||
struct Something {
|
||||
X: usize //~ ERROR structure field `X` should have a snake case name such as `x`
|
||||
|
|
@ -35,7 +35,7 @@ fn main() {
|
|||
Ok(cnt) => println!("read this many bytes: {}", cnt),
|
||||
Err(IoError{ kind: EndOfFile, .. }) => println!("Got end of file: {:?}", EndOfFile),
|
||||
//~^ ERROR variable `EndOfFile` should have a snake case name such as `end_of_file`
|
||||
//~^^ WARN `EndOfFile` is named the same as one of the variants of the type `std::io::IoErrorKind`
|
||||
//~^^ WARN `EndOfFile` is named the same as one of the variants of the type `std::old_io::IoErrorKind`
|
||||
}
|
||||
|
||||
test(1);
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@
|
|||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
fn immediate_args(a: int, b: bool, c: f64) {
|
||||
::std::io::print("") // #break
|
||||
::std::old_io::print("") // #break
|
||||
}
|
||||
|
||||
struct BigStruct {
|
||||
|
|
@ -241,21 +241,21 @@ struct BigStruct {
|
|||
}
|
||||
|
||||
fn non_immediate_args(a: BigStruct, b: BigStruct) {
|
||||
::std::io::print("") // #break
|
||||
::std::old_io::print("") // #break
|
||||
}
|
||||
|
||||
fn binding(a: i64, b: u64, c: f64) {
|
||||
let x = 0i; // #break
|
||||
::std::io::print("")
|
||||
::std::old_io::print("")
|
||||
}
|
||||
|
||||
fn assignment(mut a: u64, b: u64, c: f64) {
|
||||
a = b; // #break
|
||||
::std::io::print("")
|
||||
::std::old_io::print("")
|
||||
}
|
||||
|
||||
fn function_call(x: u64, y: u64, z: f64) {
|
||||
std::io::stdio::print("Hi!") // #break
|
||||
std::old_io::stdio::print("Hi!") // #break
|
||||
}
|
||||
|
||||
fn identifier(x: u64, y: u64, z: f64) -> u64 {
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@
|
|||
|
||||
#[no_stack_check]
|
||||
fn immediate_args(a: int, b: bool, c: f64) {
|
||||
::std::io::print("");
|
||||
::std::old_io::print("");
|
||||
}
|
||||
|
||||
struct BigStruct {
|
||||
|
|
@ -265,24 +265,24 @@ struct BigStruct {
|
|||
|
||||
#[no_stack_check]
|
||||
fn non_immediate_args(a: BigStruct, b: BigStruct) {
|
||||
::std::io::print("");
|
||||
::std::old_io::print("");
|
||||
}
|
||||
|
||||
#[no_stack_check]
|
||||
fn binding(a: i64, b: u64, c: f64) {
|
||||
let x = 0i;
|
||||
::std::io::print("");
|
||||
::std::old_io::print("");
|
||||
}
|
||||
|
||||
#[no_stack_check]
|
||||
fn assignment(mut a: u64, b: u64, c: f64) {
|
||||
a = b;
|
||||
::std::io::print("");
|
||||
::std::old_io::print("");
|
||||
}
|
||||
|
||||
#[no_stack_check]
|
||||
fn function_call(x: u64, y: u64, z: f64) {
|
||||
std::io::stdio::print("Hi!")
|
||||
std::old_io::stdio::print("Hi!")
|
||||
}
|
||||
|
||||
#[no_stack_check]
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ fn assignment(mut a: u64, b: u64, c: f64) {
|
|||
}
|
||||
|
||||
fn function_call(x: u64, y: u64, z: f64) {
|
||||
std::io::stdio::print("Hi!")
|
||||
std::old_io::stdio::print("Hi!")
|
||||
}
|
||||
|
||||
fn identifier(x: u64, y: u64, z: f64) -> u64 {
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@ extern crate issue13213aux;
|
|||
// be available because they have been optimized out from the exporting crate.
|
||||
fn main() {
|
||||
let b: issue13213aux::S = issue13213aux::A;
|
||||
::std::io::println("Nothing to do here...");
|
||||
::std::old_io::println("Nothing to do here...");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
use std::os;
|
||||
use std::io::{File, Command};
|
||||
use std::old_io::{File, Command};
|
||||
|
||||
// creates broken.rs, which has the Ident \x00name_0,ctxt_0\x00
|
||||
// embedded within it, and then attempts to compile broken.rs with the
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
use std::{char, os};
|
||||
use std::io::{File, Command};
|
||||
use std::old_io::{File, Command};
|
||||
use std::rand::{thread_rng, Rng};
|
||||
|
||||
// creates unicode_input_multiple_files_{main,chars}.rs, where the
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io::{File, Command};
|
||||
use std::old_io::{File, Command};
|
||||
use std::iter::repeat;
|
||||
use std::rand::{thread_rng, Rng};
|
||||
use std::{char, os};
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let _ = std::io::stdin();
|
||||
let _ = std::old_io::stdin();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#![feature(unsafe_destructor)]
|
||||
|
||||
use std::os;
|
||||
use std::io::process::Command;
|
||||
use std::old_io::process::Command;
|
||||
use std::str;
|
||||
use std::ops::{Drop, FnMut, FnOnce};
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ extern crate log;
|
|||
use log::{set_logger, Logger, LogRecord};
|
||||
use std::sync::mpsc::channel;
|
||||
use std::fmt;
|
||||
use std::io::{ChanReader, ChanWriter};
|
||||
use std::old_io::{ChanReader, ChanWriter};
|
||||
use std::thread::Thread;
|
||||
|
||||
struct MyWriter(ChanWriter);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#![feature(unboxed_closures)]
|
||||
|
||||
use std::mem;
|
||||
use std::io::stdio::println;
|
||||
use std::old_io::stdio::println;
|
||||
|
||||
fn call_it<F>(f: F)
|
||||
where F : FnOnce(String) -> String
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// no-pretty-expanded
|
||||
|
||||
#![allow(unused_must_use, dead_code, deprecated)]
|
||||
use std::io::MemWriter;
|
||||
use std::old_io::MemWriter;
|
||||
use std::fmt;
|
||||
|
||||
struct Foo<'a> {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
extern crate libc;
|
||||
|
||||
use std::io::{Process, Command, timer};
|
||||
use std::old_io::{Process, Command, timer};
|
||||
use std::time::Duration;
|
||||
use std::str;
|
||||
use std::sync::mpsc::channel;
|
||||
|
|
@ -56,8 +56,8 @@ fn test_destroy_twice() {
|
|||
}
|
||||
|
||||
pub fn test_destroy_actually_kills(force: bool) {
|
||||
use std::io::process::{Command, ProcessOutput, ExitStatus, ExitSignal};
|
||||
use std::io::timer;
|
||||
use std::old_io::process::{Command, ProcessOutput, ExitStatus, ExitSignal};
|
||||
use std::old_io::timer;
|
||||
use libc;
|
||||
use std::str;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
// that we don't die in a large ball of fire
|
||||
|
||||
use std::os;
|
||||
use std::io::process;
|
||||
use std::old_io::process;
|
||||
|
||||
pub fn main () {
|
||||
let args = os::args();
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
extern crate rbml;
|
||||
extern crate serialize;
|
||||
|
||||
use std::io;
|
||||
use std::old_io;
|
||||
use std::fmt;
|
||||
use std::io::{IoResult, SeekStyle};
|
||||
use std::old_io::{IoResult, SeekStyle};
|
||||
use std::slice;
|
||||
|
||||
use serialize::{Encodable, Encoder};
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ fn main() {
|
|||
}
|
||||
|
||||
fn customtask() {
|
||||
let mut timer = std::io::timer::Timer::new().unwrap();
|
||||
let mut timer = std::old_io::timer::Timer::new().unwrap();
|
||||
let periodic = timer.periodic(Duration::milliseconds(10));
|
||||
periodic.recv();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io::timer;
|
||||
use std::old_io::timer;
|
||||
use std::time::Duration;
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// ignore-fast
|
||||
|
||||
use std::os;
|
||||
use std::io;
|
||||
use std::old_io;
|
||||
use std::str;
|
||||
|
||||
fn main() {
|
||||
|
|
@ -27,7 +27,7 @@ fn main() {
|
|||
fn parent() {
|
||||
let args = os::args();
|
||||
let args = args.as_slice();
|
||||
let mut p = io::process::Command::new(args[0].as_slice())
|
||||
let mut p = old_io::process::Command::new(args[0].as_slice())
|
||||
.arg("child").spawn().unwrap();
|
||||
p.stdin.as_mut().unwrap().write_str("test1\ntest2\ntest3").unwrap();
|
||||
let out = p.wait_with_output().unwrap();
|
||||
|
|
@ -37,7 +37,7 @@ fn parent() {
|
|||
}
|
||||
|
||||
fn child() {
|
||||
for line in io::stdin().lock().lines() {
|
||||
for line in old_io::stdin().lock().lines() {
|
||||
println!("{}", line.unwrap());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
use std::io::process;
|
||||
use std::io::Command;
|
||||
use std::io;
|
||||
use std::old_io::process;
|
||||
use std::old_io::Command;
|
||||
use std::old_io;
|
||||
use std::os;
|
||||
|
||||
fn main() {
|
||||
|
|
@ -25,9 +25,9 @@ fn main() {
|
|||
}
|
||||
|
||||
fn child() {
|
||||
io::stdout().write_line("foo").unwrap();
|
||||
io::stderr().write_line("bar").unwrap();
|
||||
assert_eq!(io::stdin().lock().read_line().err().unwrap().kind, io::EndOfFile);
|
||||
old_io::stdout().write_line("foo").unwrap();
|
||||
old_io::stderr().write_line("bar").unwrap();
|
||||
assert_eq!(old_io::stdin().lock().read_line().err().unwrap().kind, old_io::EndOfFile);
|
||||
}
|
||||
|
||||
fn test() {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io::Reader;
|
||||
use std::old_io::Reader;
|
||||
|
||||
enum Wrapper<'a> {
|
||||
WrapReader(&'a (Reader + 'a))
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
use std::os;
|
||||
use std::io::{stdio, Command};
|
||||
use std::old_io::{stdio, Command};
|
||||
|
||||
fn main() {
|
||||
let args = os::args();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
use std::slice::SliceExt;
|
||||
use std::io::{Command, fs, USER_RWX};
|
||||
use std::old_io::{Command, fs, USER_RWX};
|
||||
use std::os;
|
||||
use std::path::BytesContainer;
|
||||
use std::rand::random;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io::{process, Command};
|
||||
use std::old_io::{process, Command};
|
||||
use std::os;
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
use std::thread::Thread;
|
||||
|
||||
pub fn main() {
|
||||
let mut stdin = std::io::stdin();
|
||||
let mut stdin = std::old_io::stdin();
|
||||
Thread::spawn(move|| {
|
||||
let _ = stdin.read_to_end();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io::BufReader;
|
||||
use std::io::BufferedReader;
|
||||
use std::io::File;
|
||||
use std::io::IoResult;
|
||||
use std::old_io::BufReader;
|
||||
use std::old_io::BufferedReader;
|
||||
use std::old_io::File;
|
||||
use std::old_io::IoResult;
|
||||
|
||||
struct Lexer<R: Reader>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@
|
|||
#![allow(unknown_features)]
|
||||
#![feature(box_syntax)]
|
||||
|
||||
use std::io;
|
||||
use std::old_io;
|
||||
|
||||
fn f(wr: &mut Writer) {
|
||||
wr.write_str("hello").ok().expect("failed");
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut wr = box io::stdout() as Box<Writer + 'static>;
|
||||
let mut wr = box old_io::stdout() as Box<Writer + 'static>;
|
||||
f(&mut wr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io::FileType;
|
||||
use std::old_io::FileType;
|
||||
|
||||
pub fn main() {
|
||||
let _ = FileType::RegularFile.clone();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// ignore-windows currently windows requires UTF-8 for spawning processes
|
||||
|
||||
use std::io::Command;
|
||||
use std::old_io::Command;
|
||||
use std::os;
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
use std::iter;
|
||||
use std::os;
|
||||
use std::io::File;
|
||||
use std::old_io::File;
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn parse_summary<R: Reader>(_: R, _: &Path) {
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@
|
|||
// Regression test for #20797.
|
||||
|
||||
use std::default::Default;
|
||||
use std::io::IoResult;
|
||||
use std::io::fs;
|
||||
use std::io::fs::PathExtensions;
|
||||
use std::old_io::IoResult;
|
||||
use std::old_io::fs;
|
||||
use std::old_io::fs::PathExtensions;
|
||||
|
||||
/// A strategy for acquiring more subpaths to walk.
|
||||
pub trait Strategy {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
/// Map representation
|
||||
|
||||
use std::io;
|
||||
use std::old_io;
|
||||
use std::fmt;
|
||||
use square::{bot, wall, rock, lambda, closed_lift, open_lift, earth, empty};
|
||||
|
||||
|
|
@ -59,9 +59,9 @@ fn square_from_char(c: char) -> square {
|
|||
}
|
||||
}
|
||||
|
||||
fn read_board_grid<rdr:'static + io::Reader>(mut input: rdr)
|
||||
fn read_board_grid<rdr:'static + old_io::Reader>(mut input: rdr)
|
||||
-> Vec<Vec<square>> {
|
||||
let mut input: &mut io::Reader = &mut input;
|
||||
let mut input: &mut old_io::Reader = &mut input;
|
||||
let mut grid = Vec::new();
|
||||
let mut line = [0; 10];
|
||||
input.read(&mut line);
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io;
|
||||
use std::old_io;
|
||||
|
||||
pub fn main() {
|
||||
let stdout = &mut io::stdout() as &mut io::Writer;
|
||||
let stdout = &mut old_io::stdout() as &mut old_io::Writer;
|
||||
stdout.write(b"Hello!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io::println;
|
||||
use std::old_io::println;
|
||||
use std::sync::mpsc::channel;
|
||||
use std::thread::Thread;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io;
|
||||
use std::old_io;
|
||||
trait B {
|
||||
fn f(&self);
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ trait T : B {
|
|||
struct A;
|
||||
|
||||
impl<U: T> B for U {
|
||||
fn f(&self) { io::println("Hey, I'm a T!"); }
|
||||
fn f(&self) { old_io::println("Hey, I'm a T!"); }
|
||||
}
|
||||
|
||||
impl T for A {
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io;
|
||||
use std::old_io;
|
||||
|
||||
fn foo(a: &mut io::Writer) {
|
||||
fn foo(a: &mut old_io::Writer) {
|
||||
a.write(&[]).unwrap();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
use std::sync::mpsc::{TryRecvError, channel};
|
||||
use std::io::timer::Timer;
|
||||
use std::old_io::timer::Timer;
|
||||
use std::thread::Thread;
|
||||
use std::time::Duration;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
use std::io::Command;
|
||||
use std::old_io::Command;
|
||||
use std::os;
|
||||
use std::str;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
use std::raw;
|
||||
use std::mem;
|
||||
use std::slice;
|
||||
use std::io::IoResult;
|
||||
use std::old_io::IoResult;
|
||||
|
||||
trait MyWriter {
|
||||
fn my_write(&mut self, buf: &[u8]) -> IoResult<()>;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#![feature(asm)]
|
||||
|
||||
use std::io::process::Command;
|
||||
use std::old_io::process::Command;
|
||||
use std::os;
|
||||
use std::thread::Thread;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#![feature(asm)]
|
||||
|
||||
use std::io::process::Command;
|
||||
use std::old_io::process::Command;
|
||||
use std::os;
|
||||
|
||||
// lifted from the test module
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![feature(asm)]
|
||||
|
||||
use std::io::process::Command;
|
||||
use std::old_io::process::Command;
|
||||
use std::os;
|
||||
|
||||
// lifted from the test module
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io::Command;
|
||||
use std::old_io::Command;
|
||||
use std::os;
|
||||
|
||||
#[cfg(all(unix, not(target_os="android")))]
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
// non-ASCII characters. The child process ensures all the strings are
|
||||
// intact.
|
||||
|
||||
use std::io;
|
||||
use std::io::fs;
|
||||
use std::io::Command;
|
||||
use std::old_io;
|
||||
use std::old_io::fs;
|
||||
use std::old_io::Command;
|
||||
use std::os;
|
||||
use std::path::Path;
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ fn main() {
|
|||
let child_path = cwd.join(child_filename);
|
||||
|
||||
// make a separate directory for the child
|
||||
drop(fs::mkdir(&cwd, io::USER_RWX).is_ok());
|
||||
drop(fs::mkdir(&cwd, old_io::USER_RWX).is_ok());
|
||||
assert!(fs::copy(&my_path, &child_path).is_ok());
|
||||
let mut my_env = my_env;
|
||||
my_env.push(env);
|
||||
|
|
@ -62,8 +62,8 @@ fn main() {
|
|||
.spawn().unwrap().wait_with_output().unwrap();
|
||||
|
||||
// display the output
|
||||
assert!(io::stdout().write(p.output.as_slice()).is_ok());
|
||||
assert!(io::stderr().write(p.error.as_slice()).is_ok());
|
||||
assert!(old_io::stdout().write(p.output.as_slice()).is_ok());
|
||||
assert!(old_io::stderr().write(p.error.as_slice()).is_ok());
|
||||
|
||||
// make sure the child succeeded
|
||||
assert!(p.status.success());
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@
|
|||
extern crate libc;
|
||||
|
||||
use std::ffi::CString;
|
||||
use std::io::TempDir;
|
||||
use std::io::fs::PathExtensions;
|
||||
use std::io::fs;
|
||||
use std::io;
|
||||
use std::old_io::TempDir;
|
||||
use std::old_io::fs::PathExtensions;
|
||||
use std::old_io::fs;
|
||||
use std::old_io;
|
||||
use std::os;
|
||||
|
||||
fn rename_directory() {
|
||||
|
|
@ -27,7 +27,7 @@ fn rename_directory() {
|
|||
let tmpdir = TempDir::new("rename_directory").ok().expect("rename_directory failed");
|
||||
let tmpdir = tmpdir.path();
|
||||
let old_path = tmpdir.join_many(&["foo", "bar", "baz"]);
|
||||
fs::mkdir_recursive(&old_path, io::USER_RWX);
|
||||
fs::mkdir_recursive(&old_path, old_io::USER_RWX);
|
||||
let test_file = &old_path.join("temp.txt");
|
||||
|
||||
/* Write the temp input file */
|
||||
|
|
@ -45,7 +45,7 @@ fn rename_directory() {
|
|||
assert_eq!(libc::fclose(ostream), (0u as libc::c_int));
|
||||
|
||||
let new_path = tmpdir.join_many(&["quux", "blat"]);
|
||||
fs::mkdir_recursive(&new_path, io::USER_RWX);
|
||||
fs::mkdir_recursive(&new_path, old_io::USER_RWX);
|
||||
fs::rename(&old_path, &new_path.join("newdir"));
|
||||
assert!(new_path.join("newdir").is_dir());
|
||||
assert!(new_path.join_many(&["newdir", "temp.txt"]).exists());
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#![feature(start)]
|
||||
|
||||
use std::ffi;
|
||||
use std::io::process::{Command, ProcessOutput};
|
||||
use std::old_io::process::{Command, ProcessOutput};
|
||||
use std::os;
|
||||
use std::rt::unwind::try;
|
||||
use std::rt;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io::process::Command;
|
||||
use std::old_io::process::Command;
|
||||
use std::os;
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// ignore-windows
|
||||
|
||||
use std::os;
|
||||
use std::io::process::{Command, ExitSignal, ExitStatus};
|
||||
use std::old_io::process::{Command, ExitSignal, ExitStatus};
|
||||
|
||||
pub fn main() {
|
||||
let args = os::args();
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
// doesn't die in a ball of fire, but rather it's gracefully handled.
|
||||
|
||||
use std::os;
|
||||
use std::io::PipeStream;
|
||||
use std::io::Command;
|
||||
use std::old_io::PipeStream;
|
||||
use std::old_io::Command;
|
||||
|
||||
fn test() {
|
||||
let os::Pipe { reader, writer } = unsafe { os::pipe().unwrap() };
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::io::fs::PathExtensions;
|
||||
use std::io::{File, TempDir};
|
||||
use std::old_io::fs::PathExtensions;
|
||||
use std::old_io::{File, TempDir};
|
||||
|
||||
pub fn main() {
|
||||
let dir = TempDir::new_in(&Path::new("."), "").unwrap();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
use std::sync::mpsc::channel;
|
||||
use std::io::{ChanReader, ChanWriter};
|
||||
use std::old_io::{ChanReader, ChanWriter};
|
||||
use std::thread;
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
// quite quickly and it takes a few seconds for the sockets to get
|
||||
// recycled.
|
||||
|
||||
use std::io::{TcpListener, Listener, Acceptor, EndOfFile, TcpStream};
|
||||
use std::old_io::{TcpListener, Listener, Acceptor, EndOfFile, TcpStream};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::mpsc::channel;
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@
|
|||
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use std::io::*;
|
||||
use std::io::test::*;
|
||||
use std::io;
|
||||
use std::old_io::*;
|
||||
use std::old_io::test::*;
|
||||
use std::old_io;
|
||||
use std::time::Duration;
|
||||
use std::sync::mpsc::channel;
|
||||
use std::thread::Thread;
|
||||
|
|
@ -45,7 +45,7 @@ fn eventual_timeout() {
|
|||
for _ in range(0u, 10000) {
|
||||
match TcpStream::connect_timeout(addr, Duration::milliseconds(100)) {
|
||||
Ok(e) => v.push(e),
|
||||
Err(ref e) if e.kind == io::TimedOut => return,
|
||||
Err(ref e) if e.kind == old_io::TimedOut => return,
|
||||
Err(e) => panic!("other error: {}", e),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,15 +17,15 @@ extern crate log;
|
|||
extern crate libc;
|
||||
|
||||
use std::sync::mpsc::channel;
|
||||
use std::io::net::tcp::{TcpListener, TcpStream};
|
||||
use std::io::{Acceptor, Listener};
|
||||
use std::old_io::net::tcp::{TcpListener, TcpStream};
|
||||
use std::old_io::{Acceptor, Listener};
|
||||
use std::thread::{Builder, Thread};
|
||||
use std::time::Duration;
|
||||
|
||||
fn main() {
|
||||
// This test has a chance to time out, try to not let it time out
|
||||
Thread::spawn(move|| -> () {
|
||||
use std::io::timer;
|
||||
use std::old_io::timer;
|
||||
timer::sleep(Duration::milliseconds(30 * 1000));
|
||||
println!("timed out!");
|
||||
unsafe { libc::exit(1) }
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@
|
|||
// they're in a different location than before. Hence, these tests are all run
|
||||
// serially here.
|
||||
|
||||
use std::io::fs::PathExtensions;
|
||||
use std::io::{fs, TempDir};
|
||||
use std::io;
|
||||
use std::old_io::fs::PathExtensions;
|
||||
use std::old_io::{fs, TempDir};
|
||||
use std::old_io;
|
||||
use std::os;
|
||||
use std::sync::mpsc::channel;
|
||||
use std::thread::Thread;
|
||||
|
|
@ -127,17 +127,17 @@ fn recursive_mkdir_rel() {
|
|||
let cwd = os::getcwd().unwrap();
|
||||
println!("recursive_mkdir_rel: Making: {} in cwd {} [{}]", path.display(),
|
||||
cwd.display(), path.exists());
|
||||
fs::mkdir_recursive(&path, io::USER_RWX);
|
||||
fs::mkdir_recursive(&path, old_io::USER_RWX);
|
||||
assert!(path.is_dir());
|
||||
fs::mkdir_recursive(&path, io::USER_RWX);
|
||||
fs::mkdir_recursive(&path, old_io::USER_RWX);
|
||||
assert!(path.is_dir());
|
||||
}
|
||||
|
||||
fn recursive_mkdir_dot() {
|
||||
let dot = Path::new(".");
|
||||
fs::mkdir_recursive(&dot, io::USER_RWX);
|
||||
fs::mkdir_recursive(&dot, old_io::USER_RWX);
|
||||
let dotdot = Path::new("..");
|
||||
fs::mkdir_recursive(&dotdot, io::USER_RWX);
|
||||
fs::mkdir_recursive(&dotdot, old_io::USER_RWX);
|
||||
}
|
||||
|
||||
fn recursive_mkdir_rel_2() {
|
||||
|
|
@ -145,20 +145,20 @@ fn recursive_mkdir_rel_2() {
|
|||
let cwd = os::getcwd().unwrap();
|
||||
println!("recursive_mkdir_rel_2: Making: {} in cwd {} [{}]", path.display(),
|
||||
cwd.display(), path.exists());
|
||||
fs::mkdir_recursive(&path, io::USER_RWX);
|
||||
fs::mkdir_recursive(&path, old_io::USER_RWX);
|
||||
assert!(path.is_dir());
|
||||
assert!(path.dir_path().is_dir());
|
||||
let path2 = Path::new("quux/blat");
|
||||
println!("recursive_mkdir_rel_2: Making: {} in cwd {}", path2.display(),
|
||||
cwd.display());
|
||||
fs::mkdir_recursive(&path2, io::USER_RWX);
|
||||
fs::mkdir_recursive(&path2, old_io::USER_RWX);
|
||||
assert!(path2.is_dir());
|
||||
assert!(path2.dir_path().is_dir());
|
||||
}
|
||||
|
||||
// Ideally this would be in core, but needs TempFile
|
||||
pub fn test_rmdir_recursive_ok() {
|
||||
let rwx = io::USER_RWX;
|
||||
let rwx = old_io::USER_RWX;
|
||||
|
||||
let tmpdir = TempDir::new("test").ok().expect("test_rmdir_recursive_ok: \
|
||||
couldn't create temp dir");
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#![allow(unknown_features)]
|
||||
#![feature(box_syntax)]
|
||||
|
||||
use std::io;
|
||||
use std::old_io;
|
||||
|
||||
trait Trait {
|
||||
fn f(&self);
|
||||
|
|
@ -41,7 +41,7 @@ pub fn main() {
|
|||
let c: &Trait = &a;
|
||||
c.f();
|
||||
|
||||
let out = io::stdout();
|
||||
let out = old_io::stdout();
|
||||
foo(box out);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
extern crate libc;
|
||||
|
||||
use std::io::process::Command;
|
||||
use std::old_io::process::Command;
|
||||
|
||||
use libc::funcs::posix88::unistd;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue