diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-22 09:04:23 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-29 08:58:21 -0800 |
| commit | c32d03f4172580e3f33e4844ed3c01234dca2d53 (patch) | |
| tree | 70c57ebe6a3b5f6e8cb4609c918f9455671926be /src/libtest | |
| parent | 3dcc409fac18a258ba2a8af4345d9566ec8eebad (diff) | |
| download | rust-c32d03f4172580e3f33e4844ed3c01234dca2d53.tar.gz rust-c32d03f4172580e3f33e4844ed3c01234dca2d53.zip | |
std: Stabilize the prelude module
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
Diffstat (limited to 'src/libtest')
| -rw-r--r-- | src/libtest/lib.rs | 11 | ||||
| -rw-r--r-- | src/libtest/stats.rs | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 88dd6fce88f..fc9826a913c 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -49,8 +49,6 @@ use self::TestEvent::*; use self::NamePadding::*; use self::OutputLocation::*; -use std::any::{Any, AnyRefExt}; -use std::collections::BTreeMap; use stats::Stats; use getopts::{OptGroup, optflag, optopt}; use regex::Regex; @@ -58,7 +56,10 @@ use serialize::{json, Decodable, Encodable}; use term::Terminal; use term::color::{Color, RED, YELLOW, GREEN, CYAN}; +use std::any::{Any, AnyRefExt}; use std::cmp; +use std::collections::BTreeMap; +use std::comm::{channel, Sender}; use std::f64; use std::fmt::Show; use std::fmt; @@ -69,11 +70,10 @@ use std::io; use std::iter::repeat; use std::num::{Float, FloatMath, Int}; use std::os; -use std::str::FromStr; -use std::string::String; +use std::str::{FromStr, from_str}; use std::thread::{mod, Thread}; -use std::time::Duration; use std::thunk::{Thunk, Invoke}; +use std::time::Duration; // to be used by rustc to compile tests in libtest pub mod test { @@ -1466,6 +1466,7 @@ mod tests { StaticTestName, DynTestName, DynTestFn, ShouldFail}; use std::io::TempDir; use std::thunk::Thunk; + use std::comm::channel; #[test] pub fn do_not_run_ignored_tests() { diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index 41146cded70..ed6a00a8e91 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -10,13 +10,14 @@ #![allow(missing_docs)] -use std::collections::hash_map; +use std::cmp::Ordering::{mod, Less, Greater, Equal}; use std::collections::hash_map::Entry::{Occupied, Vacant}; +use std::collections::hash_map; use std::fmt::Show; use std::hash::Hash; use std::io; use std::mem; -use std::num::{Float, FloatMath}; +use std::num::{Float, FloatMath, FromPrimitive}; fn local_cmp<T:Float>(x: T, y: T) -> Ordering { // arbitrarily decide that NaNs are larger than everything. |
