diff options
| author | bors <bors@rust-lang.org> | 2015-03-15 21:16:04 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-15 21:16:04 +0000 |
| commit | c62ae87db20cf070c5546f5aa814164d2445ec37 (patch) | |
| tree | fa8658d0f9c77946d896eb91691f28dc4a25d114 /src/libtest | |
| parent | 542e2bb3910f8860d49b4b40bcd78d9c74e733ff (diff) | |
| parent | 6e92f0580b0bfe8433df73a9139eaa72c47258b2 (diff) | |
| download | rust-c62ae87db20cf070c5546f5aa814164d2445ec37.tar.gz rust-c62ae87db20cf070c5546f5aa814164d2445ec37.zip | |
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?
Diffstat (limited to 'src/libtest')
| -rw-r--r-- | src/libtest/lib.rs | 11 | ||||
| -rw-r--r-- | src/libtest/stats.rs | 19 |
2 files changed, 2 insertions, 28 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 3de24b1383f..8fe0cd6ebd4 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -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(()) diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index 42812e1e597..84d86c5746c 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -11,9 +11,6 @@ #![allow(missing_docs)] use std::cmp::Ordering::{self, Less, Greater, Equal}; -use std::collections::hash_map::Entry::{Occupied, Vacant}; -use std::collections::hash_map; -use std::hash::Hash; use std::mem; use std::num::{Float, FromPrimitive}; @@ -330,22 +327,6 @@ pub fn winsorize<T: Float + FromPrimitive>(samples: &mut [T], pct: T) { } } -/// Returns a HashMap with the number of occurrences of every element in the -/// sequence that the iterator exposes. -#[cfg(not(stage0))] -pub fn freq_count<T, U>(iter: T) -> hash_map::HashMap<U, uint> - where T: Iterator<Item=U>, U: Eq + Clone + Hash -{ - let mut map: hash_map::HashMap<U,uint> = hash_map::HashMap::new(); - for elem in iter { - match map.entry(elem) { - Occupied(mut entry) => { *entry.get_mut() += 1; }, - Vacant(entry) => { entry.insert(1); }, - } - } - map -} - // Test vectors generated from R, using the script src/etc/stat-test-vectors.r. #[cfg(test)] |
