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/libstd/num | |
| 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/libstd/num')
| -rw-r--r-- | src/libstd/num/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index dad8b70ceac..d010a5de622 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -951,7 +951,7 @@ mod tests { test_checked_next_power_of_two! { test_checked_next_power_of_two_u64, u64 } test_checked_next_power_of_two! { test_checked_next_power_of_two_uint, uint } - #[derive(PartialEq, Show)] + #[derive(PartialEq, Debug)] struct Value { x: int } impl ToPrimitive for Value { @@ -1001,7 +1001,7 @@ mod tests { fn test_pow() { fn naive_pow<T: Int>(base: T, exp: uint) -> T { let one: T = Int::one(); - range(0, exp).fold(one, |acc, _| acc * base) + (0..exp).fold(one, |acc, _| acc * base) } macro_rules! assert_pow { (($num:expr, $exp:expr) => $expected:expr) => {{ @@ -1028,7 +1028,7 @@ mod bench { #[bench] fn bench_pow_function(b: &mut Bencher) { - let v = range(0, 1024u).collect::<Vec<_>>(); + let v = (0..1024u).collect::<Vec<_>>(); b.iter(|| {v.iter().fold(0u, |old, new| old.pow(*new));}); } } |
