]> git.lizzy.rs Git - rust.git/commitdiff
fix inference fallout
authorJorge Aparicio <japaricious@gmail.com>
Tue, 27 Jan 2015 00:08:22 +0000 (19:08 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Thu, 29 Jan 2015 12:49:01 +0000 (07:49 -0500)
src/libcollections/bit.rs
src/libcollections/ring_buf.rs
src/libcollections/slice.rs
src/librbml/lib.rs
src/libstd/collections/hash/map.rs
src/libstd/collections/hash/set.rs
src/libtest/stats.rs
src/test/run-pass/issue-15673.rs
src/test/run-pass/issue-2989.rs

index 56663f23a7e97bf6f4b2cdd35bb9ed3b96f1ef82..c627574057969d93a479d779b19bf1d2d37d0ce4 100644 (file)
@@ -66,7 +66,7 @@
 //! };
 //!
 //! // Simple primality tests below our max bound
-//! let print_primes = 20;
+//! let print_primes = 20u;
 //! print!("The primes below {} are: ", print_primes);
 //! for x in 0..print_primes {
 //!     if primes.contains(&x) {
@@ -2283,7 +2283,7 @@ fn test_bitv_iterator() {
 
         assert_eq!(bitv.iter().collect::<Vec<bool>>(), bools);
 
-        let long = (0..10000).map(|i| i % 2 == 0).collect::<Vec<_>>();
+        let long = (0i32..10000).map(|i| i % 2 == 0).collect::<Vec<_>>();
         let bitv: Bitv = long.iter().map(|n| *n).collect();
         assert_eq!(bitv.iter().collect::<Vec<bool>>(), long)
     }
index 14f1f88613ae13630dea11edb4acf553bbffef73..2e2ae11128504d7cc7092e0c8fc528dd154bd5c2 100644 (file)
@@ -2126,7 +2126,7 @@ fn test_into_iter() {
             for i in 0i..5 {
                 d.push_back(i);
             }
-            for i in 6..9 {
+            for i in 6i..9 {
                 d.push_front(i);
             }
 
@@ -2140,7 +2140,7 @@ fn test_into_iter() {
             for i in 0i..5 {
                 d.push_back(i);
             }
-            for i in 6..9 {
+            for i in 6i..9 {
                 d.push_front(i);
             }
 
@@ -2190,7 +2190,7 @@ fn test_drain() {
             for i in 0i..5 {
                 d.push_back(i);
             }
-            for i in 6..9 {
+            for i in 6i..9 {
                 d.push_front(i);
             }
 
@@ -2204,7 +2204,7 @@ fn test_drain() {
             for i in 0i..5 {
                 d.push_back(i);
             }
-            for i in 6..9 {
+            for i in 6i..9 {
                 d.push_front(i);
             }
 
index 1046e3077eaaa7c88d0dcd8422e1328fb04da076..740d5759d9a9621b37470ee0b8320e638fa6e686 100644 (file)
@@ -1526,7 +1526,7 @@ fn is_odd(n: &uint) -> bool { *n % 2u == 1u }
     #[test]
     fn test_from_fn() {
         // Test on-stack from_fn.
-        let mut v = (0..3).map(square).collect::<Vec<_>>();
+        let mut v = (0u..3).map(square).collect::<Vec<_>>();
         {
             let v = v.as_slice();
             assert_eq!(v.len(), 3u);
@@ -1536,7 +1536,7 @@ fn test_from_fn() {
         }
 
         // Test on-heap from_fn.
-        v = (0..5).map(square).collect::<Vec<_>>();
+        v = (0u..5).map(square).collect::<Vec<_>>();
         {
             let v = v.as_slice();
             assert_eq!(v.len(), 5u);
@@ -2908,7 +2908,7 @@ fn push(b: &mut Bencher) {
 
     #[bench]
     fn starts_with_same_vector(b: &mut Bencher) {
-        let vec: Vec<uint> = (0..100).collect();
+        let vec: Vec<uint> = (0u..100).collect();
         b.iter(|| {
             vec.starts_with(vec.as_slice())
         })
@@ -2924,8 +2924,8 @@ fn starts_with_single_element(b: &mut Bencher) {
 
     #[bench]
     fn starts_with_diff_one_element_at_end(b: &mut Bencher) {
-        let vec: Vec<uint> = (0..100).collect();
-        let mut match_vec: Vec<uint> = (0..99).collect();
+        let vec: Vec<uint> = (0u..100).collect();
+        let mut match_vec: Vec<uint> = (0u..99).collect();
         match_vec.push(0);
         b.iter(|| {
             vec.starts_with(match_vec.as_slice())
@@ -2934,7 +2934,7 @@ fn starts_with_diff_one_element_at_end(b: &mut Bencher) {
 
     #[bench]
     fn ends_with_same_vector(b: &mut Bencher) {
-        let vec: Vec<uint> = (0..100).collect();
+        let vec: Vec<uint> = (0u..100).collect();
         b.iter(|| {
             vec.ends_with(vec.as_slice())
         })
@@ -2950,8 +2950,8 @@ fn ends_with_single_element(b: &mut Bencher) {
 
     #[bench]
     fn ends_with_diff_one_element_at_beginning(b: &mut Bencher) {
-        let vec: Vec<uint> = (0..100).collect();
-        let mut match_vec: Vec<uint> = (0..100).collect();
+        let vec: Vec<uint> = (0u..100).collect();
+        let mut match_vec: Vec<uint> = (0u..100).collect();
         match_vec.as_mut_slice()[0] = 200;
         b.iter(|| {
             vec.starts_with(match_vec.as_slice())
@@ -2960,7 +2960,7 @@ fn ends_with_diff_one_element_at_beginning(b: &mut Bencher) {
 
     #[bench]
     fn contains_last_element(b: &mut Bencher) {
-        let vec: Vec<uint> = (0..100).collect();
+        let vec: Vec<uint> = (0u..100).collect();
         b.iter(|| {
             vec.contains(&99u)
         })
index e71ea92e69327cc414a4e9255c1c3f0804558305..da35eef63470c28e67d08655835b5e1a2a0ca9c6 100644 (file)
@@ -1184,7 +1184,7 @@ mod bench {
 
     #[bench]
     pub fn vuint_at_A_aligned(b: &mut Bencher) {
-        let data = (0..4*100).map(|i| {
+        let data = (0i32..4*100).map(|i| {
             match i % 2 {
               0 => 0x80u8,
               _ => i as u8,
@@ -1202,7 +1202,7 @@ pub fn vuint_at_A_aligned(b: &mut Bencher) {
 
     #[bench]
     pub fn vuint_at_A_unaligned(b: &mut Bencher) {
-        let data = (0..4*100+1).map(|i| {
+        let data = (0i32..4*100+1).map(|i| {
             match i % 2 {
               1 => 0x80u8,
               _ => i as u8
@@ -1220,7 +1220,7 @@ pub fn vuint_at_A_unaligned(b: &mut Bencher) {
 
     #[bench]
     pub fn vuint_at_D_aligned(b: &mut Bencher) {
-        let data = (0..4*100).map(|i| {
+        let data = (0i32..4*100).map(|i| {
             match i % 4 {
               0 => 0x10u8,
               3 => i as u8,
@@ -1239,7 +1239,7 @@ pub fn vuint_at_D_aligned(b: &mut Bencher) {
 
     #[bench]
     pub fn vuint_at_D_unaligned(b: &mut Bencher) {
-        let data = (0..4*100+1).map(|i| {
+        let data = (0i32..4*100+1).map(|i| {
             match i % 4 {
               1 => 0x10u8,
               0 => i as u8,
index f5937e5f902fa47dd969adc51ef71a45e288a9fa..a291ec16a62440183b0b7385f831dc794ec4e480 100644 (file)
@@ -2094,18 +2094,18 @@ fn test_reserve_shrink_to_fit() {
         m.insert(0u, 0u);
         m.remove(&0);
         assert!(m.capacity() >= m.len());
-        for i in 0..128 {
+        for i in 0us..128 {
             m.insert(i, i);
         }
         m.reserve(256);
 
         let usable_cap = m.capacity();
-        for i in 128..128+256 {
+        for i in 128us..128+256 {
             m.insert(i, i);
             assert_eq!(m.capacity(), usable_cap);
         }
 
-        for i in 100..128+256 {
+        for i in 100us..128+256 {
             assert_eq!(m.remove(&i), Some(i));
         }
         m.shrink_to_fit();
@@ -2114,7 +2114,7 @@ fn test_reserve_shrink_to_fit() {
         assert!(!m.is_empty());
         assert!(m.capacity() >= m.len());
 
-        for i in 0..100 {
+        for i in 0us..100 {
             assert_eq!(m.remove(&i), Some(i));
         }
         m.shrink_to_fit();
index 269e4ce29fd7e5d0f3090ec870b0b338d9009b8b..2b15e50c6fac3e275311af79835598385f297588 100644 (file)
@@ -1198,7 +1198,7 @@ fn test_trivial_drain() {
 
     #[test]
     fn test_drain() {
-        let mut s: HashSet<int> = (1..100).collect();
+        let mut s: HashSet<int> = (1is..100).collect();
 
         // try this a bunch of times to make sure we don't screw up internal state.
         for _ in 0i..20 {
@@ -1217,7 +1217,7 @@ fn test_drain() {
             for _ in s.iter() { panic!("s should be empty!"); }
 
             // reset to try again.
-            s.extend(1..100);
+            s.extend(1is..100);
         }
     }
 }
index a3a8bfecab1c49ac926aea31751da0edfacc4e53..237acbd7b65b74fc89ab26175db27ede8b66fa1d 100644 (file)
@@ -939,7 +939,7 @@ pub fn sum_three_items(b: &mut Bencher) {
     #[bench]
     pub fn sum_many_f64(b: &mut Bencher) {
         let nums = [-1e30f64, 1e60, 1e30, 1.0, -1e60];
-        let v = (0..500).map(|i| nums[i%5]).collect::<Vec<_>>();
+        let v = (0us..500).map(|i| nums[i%5]).collect::<Vec<_>>();
 
         b.iter(|| {
             v.sum();
index 227d8f7b8c82ab970409f07a228386646f1f0590..7dfde2f6badfea654b24f8df7ce98c0311bff981 100644 (file)
@@ -11,5 +11,5 @@
 use std::iter::AdditiveIterator;
 fn main() {
     let x: [u64; 3] = [1, 2, 3];
-    assert_eq!(6, (0..3).map(|i| x[i]).sum());
+    assert_eq!(6, (0us..3).map(|i| x[i]).sum());
 }
index cdb7a3ea5d17b3a5769b6eb548b9314c8265455b..e18dbf2dd87b0abab60c8311db8686fcbe12b501 100644 (file)
@@ -21,7 +21,7 @@ fn to_bytes(&self) -> Vec<u8> {
 // the position of this function is significant! - if it comes before methods
 // then it works, if it comes after it then it doesn't!
 fn to_bools(bitv: Storage) -> Vec<bool> {
-    (0..8).map(|i| {
+    (0us..8).map(|i| {
         let w = i / 64;
         let b = i % 64;
         let x = 1u64 & (bitv.storage[w] >> b);