diff options
| author | bors <bors@rust-lang.org> | 2015-01-29 16:28:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-29 16:28:52 +0000 |
| commit | 265a23320dbeaeca45b889cfea684d71dec1b8e6 (patch) | |
| tree | 36775481b19e207f139d108aeb88875b695de181 /src/libtest | |
| parent | 3d6f5100aff24aa97275dc92ade728caac605560 (diff) | |
| parent | a6f9180fd61f509ebc6d666eda3f6bb42dd02573 (diff) | |
| download | rust-265a23320dbeaeca45b889cfea684d71dec1b8e6.tar.gz rust-265a23320dbeaeca45b889cfea684d71dec1b8e6.zip | |
Auto merge of #21677 - japaric:no-range, r=alexcrichton
Note: Do not merge until we get a newer snapshot that includes #21374 There was some type inference fallout (see 4th commit) because type inference with `a..b` is not as good as with `range(a, b)` (see #21672). r? @alexcrichton
Diffstat (limited to 'src/libtest')
| -rw-r--r-- | src/libtest/lib.rs | 12 | ||||
| -rw-r--r-- | src/libtest/stats.rs | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 6a773125763..8fea6bb539f 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -97,7 +97,7 @@ pub mod stats; // colons. This way if some test runner wants to arrange the tests // hierarchically it may. -#[derive(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Debug)] pub enum TestName { StaticTestName(&'static str), DynTestName(String) @@ -198,7 +198,7 @@ pub struct Bencher { pub bytes: u64, } -#[derive(Copy, Clone, Show, PartialEq, Eq, Hash)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] pub enum ShouldFail { No, Yes(Option<&'static str>) @@ -206,7 +206,7 @@ pub enum ShouldFail { // The definition of a single test. A test runner will run a list of // these. -#[derive(Clone, Show, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct TestDesc { pub name: TestName, pub ignore: bool, @@ -215,13 +215,13 @@ pub struct TestDesc { unsafe impl Send for TestDesc {} -#[derive(Show)] +#[derive(Debug)] pub struct TestDescAndFn { pub desc: TestDesc, pub testfn: TestFn, } -#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Debug, Copy)] pub struct Metric { value: f64, noise: f64 @@ -1008,7 +1008,7 @@ impl Bencher { pub fn iter<T, F>(&mut self, mut inner: F) where F: FnMut() -> T { self.dur = Duration::span(|| { let k = self.iterations; - for _ in range(0u64, k) { + for _ in 0u64..k { black_box(inner()); } }); diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index 49c24bd5dc9..237acbd7b65 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -172,7 +172,7 @@ impl<T: Float + FromPrimitive> Stats<T> for [T] { let mut j = 0; // This inner loop applies `hi`/`lo` summation to each // partial so that the list of partial sums remains exact. - for i in range(0, partials.len()) { + for i in 0..partials.len() { let mut y: T = partials[i]; if x.abs() < y.abs() { mem::swap(&mut x, &mut y); @@ -939,7 +939,7 @@ mod bench { #[bench] pub fn sum_many_f64(b: &mut Bencher) { let nums = [-1e30f64, 1e60, 1e30, 1.0, -1e60]; - let v = range(0, 500).map(|i| nums[i%5]).collect::<Vec<_>>(); + let v = (0us..500).map(|i| nums[i%5]).collect::<Vec<_>>(); b.iter(|| { v.sum(); |
