Auto merge of #23206 - nagisa:print-io, r=alexcrichton

r? @alexcrichton or @aturon 

This still needs to somehow figure out how to avoid unstable warnings arising from the use of unstable functions. I tried to use `#[allow_internal_unstable]` but it still spits out warnings as far as I can see. @huonw (I think you implemented it) does `#[allow_internal_unstable]` not work for some reason or am I using it incorrectly?
This commit is contained in:
bors
2015-03-15 21:16:04 +00:00
8 changed files with 62 additions and 57 deletions

View File

@@ -39,13 +39,12 @@
#![feature(collections)]
#![feature(core)]
#![feature(int_uint)]
#![feature(old_io)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(std_misc)]
#![feature(io)]
#![feature(libc)]
#![feature(set_panic)]
#![feature(set_stdio)]
extern crate getopts;
extern crate serialize;
@@ -908,7 +907,6 @@ pub fn run_test(opts: &TestOpts,
return;
}
#[allow(deprecated)] // set_stdout
fn run_test_inner(desc: TestDesc,
monitor_ch: Sender<MonitorMsg>,
nocapture: bool,
@@ -920,11 +918,6 @@ pub fn run_test(opts: &TestOpts,
}
fn flush(&mut self) -> io::Result<()> { Ok(()) }
}
impl Writer for Sink {
fn write_all(&mut self, data: &[u8]) -> std::old_io::IoResult<()> {
Writer::write_all(&mut *self.0.lock().unwrap(), data)
}
}
thread::spawn(move || {
let data = Arc::new(Mutex::new(Vec::new()));
@@ -936,7 +929,7 @@ pub fn run_test(opts: &TestOpts,
let result_guard = cfg.spawn(move || {
if !nocapture {
std::old_io::stdio::set_stdout(box Sink(data2.clone()));
io::set_print(box Sink(data2.clone()));
io::set_panic(box Sink(data2));
}
testfn.invoke(())