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
This commit is contained in:
bors
2015-01-29 16:28:52 +00:00
366 changed files with 1314 additions and 1337 deletions

View File

@@ -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());
}
});

View File

@@ -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();