about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2015-01-31 12:20:46 -0500
committerJorge Aparicio <japaricious@gmail.com>2015-02-02 13:40:18 -0500
commitd5d7e6565a4034b93d19be1edafd20730a4276bc (patch)
treef978751c20a214c9fe0cd2d60645a4e1a3b760fd /src/test
parent9f90d666e0cd9a73ef35b76b6605f9d1f69df849 (diff)
downloadrust-d5d7e6565a4034b93d19be1edafd20730a4276bc.tar.gz
rust-d5d7e6565a4034b93d19be1edafd20730a4276bc.zip
`for x in xs.iter()` -> `for x in &xs`
Diffstat (limited to 'src/test')
-rw-r--r--src/test/auxiliary/cci_nested_lib.rs2
-rw-r--r--src/test/bench/shootout-chameneos-redux.rs6
-rw-r--r--src/test/bench/shootout-fasta-redux.rs4
-rw-r--r--src/test/bench/shootout-k-nucleotide-pipes.rs4
-rw-r--r--src/test/bench/shootout-k-nucleotide.rs2
-rw-r--r--src/test/bench/shootout-mandelbrot.rs2
-rw-r--r--src/test/bench/shootout-meteor.rs4
-rw-r--r--src/test/bench/shootout-nbody.rs2
-rw-r--r--src/test/compile-fail/borrowck-for-loop-correct-cmt-for-pattern.rs2
-rw-r--r--src/test/compile-fail/borrowck-for-loop-head-linkage.rs2
-rw-r--r--src/test/compile-fail/borrowck-insert-during-each.rs2
-rw-r--r--src/test/compile-fail/drop-with-active-borrows-1.rs2
-rw-r--r--src/test/compile-fail/issue-15480.rs2
-rw-r--r--src/test/compile-fail/issue-18400.rs2
-rw-r--r--src/test/compile-fail/issue-2149.rs2
-rw-r--r--src/test/compile-fail/issue-2150.rs2
-rw-r--r--src/test/compile-fail/issue-5100.rs2
-rw-r--r--src/test/compile-fail/issue-7573.rs4
-rw-r--r--src/test/debuginfo/destructured-for-loop-variable.rs4
-rw-r--r--src/test/debuginfo/lexical-scope-in-for-loop.rs2
-rw-r--r--src/test/debuginfo/unreachable-locals.rs10
-rw-r--r--src/test/pretty/block-comment-wchar.pp2
-rw-r--r--src/test/pretty/block-comment-wchar.rs2
-rw-r--r--src/test/pretty/for-comment.rs2
-rw-r--r--src/test/run-pass/auto-loop.rs2
-rw-r--r--src/test/run-pass/block-arg.rs2
-rw-r--r--src/test/run-pass/block-iter-1.rs2
-rw-r--r--src/test/run-pass/block-iter-2.rs2
-rw-r--r--src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs2
-rw-r--r--src/test/run-pass/break.rs4
-rw-r--r--src/test/run-pass/capture-clauses-boxed-closures.rs2
-rw-r--r--src/test/run-pass/capture-clauses-unboxed-closures.rs2
-rw-r--r--src/test/run-pass/cleanup-rvalue-for-scope.rs2
-rw-r--r--src/test/run-pass/coerce-reborrow-imm-vec-arg.rs2
-rw-r--r--src/test/run-pass/const-vec-of-fns.rs2
-rw-r--r--src/test/run-pass/explicit-self-closures.rs2
-rw-r--r--src/test/run-pass/fn-pattern-expected-type-2.rs2
-rw-r--r--src/test/run-pass/for-destruct.rs2
-rw-r--r--src/test/run-pass/for-loop-goofiness.rs2
-rw-r--r--src/test/run-pass/for-loop-panic.rs2
-rw-r--r--src/test/run-pass/foreach-external-iterators-break.rs2
-rw-r--r--src/test/run-pass/foreach-external-iterators-hashmap-break-restart.rs2
-rw-r--r--src/test/run-pass/foreach-external-iterators-hashmap.rs4
-rw-r--r--src/test/run-pass/foreach-external-iterators-nested.rs4
-rw-r--r--src/test/run-pass/foreach-external-iterators.rs2
-rw-r--r--src/test/run-pass/generic-static-methods.rs2
-rw-r--r--src/test/run-pass/hashmap-memory.rs2
-rw-r--r--src/test/run-pass/issue-10396.rs2
-rw-r--r--src/test/run-pass/issue-17068.rs2
-rw-r--r--src/test/run-pass/issue-2904.rs4
-rw-r--r--src/test/run-pass/issue-3389.rs2
-rw-r--r--src/test/run-pass/issue-3563-2.rs2
-rw-r--r--src/test/run-pass/issue-3563-3.rs2
-rw-r--r--src/test/run-pass/issue-4241.rs2
-rw-r--r--src/test/run-pass/issue-4542.rs2
-rw-r--r--src/test/run-pass/issue-5666.rs2
-rw-r--r--src/test/run-pass/issue-5688.rs2
-rw-r--r--src/test/run-pass/linear-for-loop.rs2
-rw-r--r--src/test/run-pass/loop-label-shadowing.rs2
-rw-r--r--src/test/run-pass/loop-scope.rs2
-rw-r--r--src/test/run-pass/monad.rs2
-rw-r--r--src/test/run-pass/mutability-inherits-through-fixed-length-vec.rs2
-rw-r--r--src/test/run-pass/overloaded-index-assoc-list.rs2
-rw-r--r--src/test/run-pass/packed-struct-vec.rs2
-rw-r--r--src/test/run-pass/regions-mock-tcx.rs2
-rw-r--r--src/test/run-pass/repeated-vector-syntax.rs2
-rw-r--r--src/test/run-pass/shadow.rs2
-rw-r--r--src/test/run-pass/static-impl.rs4
-rw-r--r--src/test/run-pass/task-comm-3.rs2
-rw-r--r--src/test/run-pass/trait-bounds-in-arc.rs6
-rw-r--r--src/test/run-pass/trait-generic.rs2
-rw-r--r--src/test/run-pass/vector-sort-panic-safe.rs2
72 files changed, 90 insertions, 90 deletions
diff --git a/src/test/auxiliary/cci_nested_lib.rs b/src/test/auxiliary/cci_nested_lib.rs
index 8494917c615..587af956c77 100644
--- a/src/test/auxiliary/cci_nested_lib.rs
+++ b/src/test/auxiliary/cci_nested_lib.rs
@@ -35,7 +35,7 @@ pub fn alist_get<A:Clone + 'static,
                  -> B {
     let eq_fn = lst.eq_fn;
     let data = lst.data.borrow();
-    for entry in (*data).iter() {
+    for entry in &(*data) {
         if eq_fn(entry.key.clone(), k.clone()) {
             return entry.value.clone();
         }
diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs
index 15a63e153b9..0835dd9a08e 100644
--- a/src/test/bench/shootout-chameneos-redux.rs
+++ b/src/test/bench/shootout-chameneos-redux.rs
@@ -47,8 +47,8 @@ use std::thread::Thread;
 
 fn print_complements() {
     let all = [Blue, Red, Yellow];
-    for aa in all.iter() {
-        for bb in all.iter() {
+    for aa in &all {
+        for bb in &all {
             println!("{:?} + {:?} -> {:?}", *aa, *bb, transform(*aa, *bb));
         }
     }
@@ -80,7 +80,7 @@ struct CreatureInfo {
 
 fn show_color_list(set: Vec<Color>) -> String {
     let mut out = String::new();
-    for col in set.iter() {
+    for col in &set {
         out.push(' ');
         out.push_str(format!("{:?}", col).as_slice());
     }
diff --git a/src/test/bench/shootout-fasta-redux.rs b/src/test/bench/shootout-fasta-redux.rs
index f32e98ef17d..5386fc0419d 100644
--- a/src/test/bench/shootout-fasta-redux.rs
+++ b/src/test/bench/shootout-fasta-redux.rs
@@ -92,7 +92,7 @@ static HOMO_SAPIENS: [AminoAcid;4] = [
 fn sum_and_scale(a: &'static [AminoAcid]) -> Vec<AminoAcid> {
     let mut result = Vec::new();
     let mut p = 0f32;
-    for a_i in a.iter() {
+    for a_i in a {
         let mut a_i = *a_i;
         p += a_i.p;
         a_i.p = p * LOOKUP_SCALE;
@@ -180,7 +180,7 @@ impl<'a, W: Writer> RandomFasta<'a, W> {
 
     fn nextc(&mut self) -> u8 {
         let r = self.rng(1.0);
-        for a in self.lookup.iter() {
+        for a in &self.lookup[] {
             if a.p >= r {
                 return a.c;
             }
diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs
index 2da276b722e..ad8e6551a03 100644
--- a/src/test/bench/shootout-k-nucleotide-pipes.rs
+++ b/src/test/bench/shootout-k-nucleotide-pipes.rs
@@ -56,14 +56,14 @@ fn sort_and_fmt(mm: &HashMap<Vec<u8> , uint>, total: uint) -> String {
    let mut pairs = Vec::new();
 
    // map -> [(k,%)]
-   for (key, &val) in mm.iter() {
+   for (key, &val) in mm {
       pairs.push(((*key).clone(), pct(val, total)));
    }
 
    let pairs_sorted = sortKV(pairs);
 
    let mut buffer = String::new();
-   for &(ref k, v) in pairs_sorted.iter() {
+   for &(ref k, v) in &pairs_sorted {
        buffer.push_str(format!("{:?} {:0.3}\n",
                                k.to_ascii_uppercase(),
                                v).as_slice());
diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs
index 2c3ade63f06..a7a47ff07ce 100644
--- a/src/test/bench/shootout-k-nucleotide.rs
+++ b/src/test/bench/shootout-k-nucleotide.rs
@@ -264,7 +264,7 @@ fn print_frequencies(frequencies: &Table, frame: uint) {
     vector.as_mut_slice().sort();
 
     let mut total_count = 0;
-    for &(count, _) in vector.iter() {
+    for &(count, _) in &vector {
         total_count += count;
     }
 
diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs
index 4a9c5a91dcf..754b891eb63 100644
--- a/src/test/bench/shootout-mandelbrot.rs
+++ b/src/test/bench/shootout-mandelbrot.rs
@@ -133,7 +133,7 @@ fn mandelbrot<W: old_io::Writer>(w: uint, mut out: W) -> old_io::IoResult<()> {
                 (i + 1) * chunk_size
             };
 
-            for &init_i in vec_init_i[start..end].iter() {
+            for &init_i in &vec_init_i[start..end] {
                 write_line(init_i, init_r_slice, &mut res);
             }
 
diff --git a/src/test/bench/shootout-meteor.rs b/src/test/bench/shootout-meteor.rs
index d44948e4ed2..80a21402fe1 100644
--- a/src/test/bench/shootout-meteor.rs
+++ b/src/test/bench/shootout-meteor.rs
@@ -135,7 +135,7 @@ fn transform(piece: Vec<(i32, i32)> , all: bool) -> Vec<Vec<(i32, i32)>> {
 // dx) is on the board.
 fn mask(dy: i32, dx: i32, id: usize, p: &Vec<(i32, i32)>) -> Option<u64> {
     let mut m = 1 << (50 + id);
-    for &(y, x) in p.iter() {
+    for &(y, x) in p {
         let x = x + dx + (y + (dy % 2)) / 2;
         if x < 0 || x > 4 {return None;}
         let y = y + dy;
@@ -184,7 +184,7 @@ fn is_board_unfeasible(board: u64, masks: &Vec<Vec<Vec<u64>>>) -> bool {
         if board & 1 << i != 0 { continue; }
         for (cur_id, pos_masks) in masks_at.iter().enumerate() {
             if board & 1 << (50 + cur_id) != 0 { continue; }
-            for &cur_m in pos_masks.iter() {
+            for &cur_m in pos_masks {
                 if cur_m & board != 0 { continue; }
                 coverable |= cur_m;
                 // if every coordinates can be covered and every
diff --git a/src/test/bench/shootout-nbody.rs b/src/test/bench/shootout-nbody.rs
index b2161000322..ca43216c662 100644
--- a/src/test/bench/shootout-nbody.rs
+++ b/src/test/bench/shootout-nbody.rs
@@ -158,7 +158,7 @@ fn offset_momentum(bodies: &mut [Planet;N_BODIES]) {
     let mut px = 0.0;
     let mut py = 0.0;
     let mut pz = 0.0;
-    for bi in bodies.iter() {
+    for bi in &*bodies {
         px += bi.vx * bi.mass;
         py += bi.vy * bi.mass;
         pz += bi.vz * bi.mass;
diff --git a/src/test/compile-fail/borrowck-for-loop-correct-cmt-for-pattern.rs b/src/test/compile-fail/borrowck-for-loop-correct-cmt-for-pattern.rs
index ad77953bdd8..492fd4a2c84 100644
--- a/src/test/compile-fail/borrowck-for-loop-correct-cmt-for-pattern.rs
+++ b/src/test/compile-fail/borrowck-for-loop-correct-cmt-for-pattern.rs
@@ -25,7 +25,7 @@ fn main() {
     let f = Foo {
         a: [box 3, box 4, box 5],
     };
-    for &a in f.a.iter() {  //~ ERROR cannot move out
+    for &a in &f.a {  //~ ERROR cannot move out
     }
 
     let x = Some(box 1);
diff --git a/src/test/compile-fail/borrowck-for-loop-head-linkage.rs b/src/test/compile-fail/borrowck-for-loop-head-linkage.rs
index d2f99ea696a..043ea0bf00e 100644
--- a/src/test/compile-fail/borrowck-for-loop-head-linkage.rs
+++ b/src/test/compile-fail/borrowck-for-loop-head-linkage.rs
@@ -12,7 +12,7 @@ use std::iter::repeat;
 
 fn main() {
     let mut vector = vec![1us, 2];
-    for &x in vector.iter() {
+    for &x in &vector {
         let cap = vector.capacity();
         vector.extend(repeat(0));      //~ ERROR cannot borrow
         vector[1us] = 5us;   //~ ERROR cannot borrow
diff --git a/src/test/compile-fail/borrowck-insert-during-each.rs b/src/test/compile-fail/borrowck-insert-during-each.rs
index d729af844cb..2c634865983 100644
--- a/src/test/compile-fail/borrowck-insert-during-each.rs
+++ b/src/test/compile-fail/borrowck-insert-during-each.rs
@@ -17,7 +17,7 @@ struct Foo {
 
 impl Foo {
     pub fn foo<F>(&mut self, mut fun: F) where F: FnMut(&isize) {
-        for f in self.n.iter() {
+        for f in &self.n {
             fun(f);
         }
     }
diff --git a/src/test/compile-fail/drop-with-active-borrows-1.rs b/src/test/compile-fail/drop-with-active-borrows-1.rs
index 5f5fbd0f348..dc8deb04833 100644
--- a/src/test/compile-fail/drop-with-active-borrows-1.rs
+++ b/src/test/compile-fail/drop-with-active-borrows-1.rs
@@ -12,7 +12,7 @@ fn main() {
     let a = "".to_string();
     let b: Vec<&str> = a.lines().collect();
     drop(a);    //~ ERROR cannot move out of `a` because it is borrowed
-    for s in b.iter() {
+    for s in &b {
         println!("{}", *s);
     }
 }
diff --git a/src/test/compile-fail/issue-15480.rs b/src/test/compile-fail/issue-15480.rs
index 1e4476e563b..30f58f909a0 100644
--- a/src/test/compile-fail/issue-15480.rs
+++ b/src/test/compile-fail/issue-15480.rs
@@ -14,7 +14,7 @@ fn main() {
 //~^ ERROR borrowed value does not live long enough
     ];
 
-    for &&x in v.iter() {
+    for &&x in &v {
         println!("{}", x + 3);
     }
 }
diff --git a/src/test/compile-fail/issue-18400.rs b/src/test/compile-fail/issue-18400.rs
index f3b2b3d5667..015f1fa603a 100644
--- a/src/test/compile-fail/issue-18400.rs
+++ b/src/test/compile-fail/issue-18400.rs
@@ -22,7 +22,7 @@ impl<'a, T, S> Set<&'a [T]> for S where
     }
 
     fn set(&mut self, bits: &[T]) {
-        for &bit in bits.iter() {
+        for &bit in bits {
             self.set(bit)
         }
     }
diff --git a/src/test/compile-fail/issue-2149.rs b/src/test/compile-fail/issue-2149.rs
index 691660f8971..998b9587b96 100644
--- a/src/test/compile-fail/issue-2149.rs
+++ b/src/test/compile-fail/issue-2149.rs
@@ -15,7 +15,7 @@ trait vec_monad<A> {
 impl<A> vec_monad<A> for Vec<A> {
     fn bind<B, F>(&self, mut f: F) where F: FnMut(A) -> Vec<B> {
         let mut r = panic!();
-        for elt in self.iter() { r = r + f(*elt); }
+        for elt in self { r = r + f(*elt); }
         //~^ ERROR the type of this value must be known
    }
 }
diff --git a/src/test/compile-fail/issue-2150.rs b/src/test/compile-fail/issue-2150.rs
index 68195985eec..a2711d532d2 100644
--- a/src/test/compile-fail/issue-2150.rs
+++ b/src/test/compile-fail/issue-2150.rs
@@ -16,7 +16,7 @@
 fn fail_len(v: Vec<isize> ) -> usize {
     let mut i = 3;
     panic!();
-    for x in v.iter() { i += 1us; }
+    for x in &v { i += 1us; }
     //~^ ERROR: unreachable statement
     return i;
 }
diff --git a/src/test/compile-fail/issue-5100.rs b/src/test/compile-fail/issue-5100.rs
index b051abbc7ff..474274c93fd 100644
--- a/src/test/compile-fail/issue-5100.rs
+++ b/src/test/compile-fail/issue-5100.rs
@@ -64,7 +64,7 @@ fn main() {
              ('c', 'd'),
              ('e', 'f')];
 
-    for &(x,y) in v.iter() {} // should be OK
+    for &(x,y) in &v {} // should be OK
 
     // Make sure none of the errors above were fatal
     let x: char = true; //~  ERROR mismatched types
diff --git a/src/test/compile-fail/issue-7573.rs b/src/test/compile-fail/issue-7573.rs
index 897afb1c102..c15c556f5d6 100644
--- a/src/test/compile-fail/issue-7573.rs
+++ b/src/test/compile-fail/issue-7573.rs
@@ -32,7 +32,7 @@ pub fn remove_package_from_database() {
     };
     list_database(push_id);
 
-    for l in lines_to_use.iter() {
+    for l in &lines_to_use {
         println!("{}", l.local_path);
     }
 
@@ -41,7 +41,7 @@ pub fn remove_package_from_database() {
 pub fn list_database<F>(mut f: F) where F: FnMut(&CrateId) {
     let stuff = ["foo", "bar"];
 
-    for l in stuff.iter() {
+    for l in &stuff {
         f(&CrateId::new(*l));
     }
 }
diff --git a/src/test/debuginfo/destructured-for-loop-variable.rs b/src/test/debuginfo/destructured-for-loop-variable.rs
index 08062ce8966..163771a2362 100644
--- a/src/test/debuginfo/destructured-for-loop-variable.rs
+++ b/src/test/debuginfo/destructured-for-loop-variable.rs
@@ -170,14 +170,14 @@ fn main() {
         z: true
     };
 
-    for &Struct { x, y, z } in [s].iter() {
+    for &Struct { x, y, z } in &[s] {
         zzz(); // #break
     }
 
     let tuple: (i8, u8, i16, u16, i32, u32, i64, u64, f32, f64) =
         (0x6f, 0x70, -113, 114, -115, 116, -117, 118, 119.5, 120.5);
 
-    for &(_i8, _u8, _i16, _u16, _i32, _u32, _i64, _u64, _f32, _f64) in [tuple].iter() {
+    for &(_i8, _u8, _i16, _u16, _i32, _u32, _i64, _u64, _f32, _f64) in &[tuple] {
         zzz(); // #break
     }
 
diff --git a/src/test/debuginfo/lexical-scope-in-for-loop.rs b/src/test/debuginfo/lexical-scope-in-for-loop.rs
index 1fa54e47163..fe5983cbb6a 100644
--- a/src/test/debuginfo/lexical-scope-in-for-loop.rs
+++ b/src/test/debuginfo/lexical-scope-in-for-loop.rs
@@ -94,7 +94,7 @@ fn main() {
 
     let x = 1000000; // wan meeeljen doollaars!
 
-    for &x in range.iter() {
+    for &x in &range {
         zzz(); // #break
         sentinel();
 
diff --git a/src/test/debuginfo/unreachable-locals.rs b/src/test/debuginfo/unreachable-locals.rs
index 70f8b1ccd96..8bcb54af8ba 100644
--- a/src/test/debuginfo/unreachable-locals.rs
+++ b/src/test/debuginfo/unreachable-locals.rs
@@ -26,7 +26,7 @@ fn after_return() {
     match (20i32, 'c') {
         (a, ref b) => {}
     }
-    for a in [111i32].iter() {}
+    for a in &[111i32] {}
 }
 
 fn after_panic() {
@@ -36,7 +36,7 @@ fn after_panic() {
     match (20i32, 'c') {
         (a, ref b) => {}
     }
-    for a in [111i32].iter() {}
+    for a in &[111i32] {}
 }
 
 fn after_diverging_function() {
@@ -46,7 +46,7 @@ fn after_diverging_function() {
     match (20i32, 'c') {
         (a, ref b) => {}
     }
-    for a in [111i32].iter() {}
+    for a in &[111i32] {}
 }
 
 fn after_break() {
@@ -57,7 +57,7 @@ fn after_break() {
         match (20i32, 'c') {
             (a, ref b) => {}
         }
-        for a in [111i32].iter() {}
+        for a in &[111i32] {}
     }
 }
 
@@ -69,7 +69,7 @@ fn after_continue() {
         match (20i32, 'c') {
             (a, ref b) => {}
         }
-        for a in [111i32].iter() {}
+        for a in &[111i32] {}
     }
 }
 
diff --git a/src/test/pretty/block-comment-wchar.pp b/src/test/pretty/block-comment-wchar.pp
index fbdd15b6060..5a55cb4e561 100644
--- a/src/test/pretty/block-comment-wchar.pp
+++ b/src/test/pretty/block-comment-wchar.pp
@@ -109,7 +109,7 @@ fn main() {
          '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006',
          '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F',
          '\u205F', '\u3000'];
-    for c in chars.iter() {
+    for c in &chars {
         let ws = c.is_whitespace();
         println!("{} {}" , c , ws);
     }
diff --git a/src/test/pretty/block-comment-wchar.rs b/src/test/pretty/block-comment-wchar.rs
index cc5640ce82a..c82bdcd8dcb 100644
--- a/src/test/pretty/block-comment-wchar.rs
+++ b/src/test/pretty/block-comment-wchar.rs
@@ -103,7 +103,7 @@ fn main() {
          '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006',
          '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F',
          '\u205F', '\u3000'];
-    for c in chars.iter() {
+    for c in &chars {
         let ws = c.is_whitespace();
         println!("{} {}", c , ws);
     }
diff --git a/src/test/pretty/for-comment.rs b/src/test/pretty/for-comment.rs
index 2318e783b69..0f2a667e11c 100644
--- a/src/test/pretty/for-comment.rs
+++ b/src/test/pretty/for-comment.rs
@@ -12,7 +12,7 @@
 
 fn f(v: &[int]) -> int {
     let mut n = 0;
-    for e in v.iter() {
+    for e in v {
         n = *e; // This comment once triggered pretty printer bug
     }
 
diff --git a/src/test/run-pass/auto-loop.rs b/src/test/run-pass/auto-loop.rs
index e5f4d078749..2cc7451e138 100644
--- a/src/test/run-pass/auto-loop.rs
+++ b/src/test/run-pass/auto-loop.rs
@@ -11,7 +11,7 @@
 pub fn main() {
     let mut sum = 0;
     let xs = vec!(1, 2, 3, 4, 5);
-    for x in xs.iter() {
+    for x in &xs {
         sum += *x;
     }
     assert_eq!(sum, 15);
diff --git a/src/test/run-pass/block-arg.rs b/src/test/run-pass/block-arg.rs
index d017a0dbf9a..2f530331a2b 100644
--- a/src/test/run-pass/block-arg.rs
+++ b/src/test/run-pass/block-arg.rs
@@ -13,7 +13,7 @@ pub fn main() {
     let v = vec!(-1.0f64, 0.0, 1.0, 2.0, 3.0);
 
     // Statement form does not require parentheses:
-    for i in v.iter() {
+    for i in &v {
         println!("{}", *i);
     }
 
diff --git a/src/test/run-pass/block-iter-1.rs b/src/test/run-pass/block-iter-1.rs
index b5bd4d90c2e..d5d26f42ef0 100644
--- a/src/test/run-pass/block-iter-1.rs
+++ b/src/test/run-pass/block-iter-1.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn iter_vec<T, F>(v: Vec<T> , mut f: F) where F: FnMut(&T) { for x in v.iter() { f(x); } }
+fn iter_vec<T, F>(v: Vec<T> , mut f: F) where F: FnMut(&T) { for x in &v { f(x); } }
 
 pub fn main() {
     let v = vec![1i32, 2, 3, 4, 5, 6, 7];
diff --git a/src/test/run-pass/block-iter-2.rs b/src/test/run-pass/block-iter-2.rs
index 348d9df6e7e..8c079ca4b07 100644
--- a/src/test/run-pass/block-iter-2.rs
+++ b/src/test/run-pass/block-iter-2.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn iter_vec<T, F>(v: Vec<T>, mut f: F) where F: FnMut(&T) { for x in v.iter() { f(x); } }
+fn iter_vec<T, F>(v: Vec<T>, mut f: F) where F: FnMut(&T) { for x in &v { f(x); } }
 
 pub fn main() {
     let v = vec![1i32, 2, 3, 4, 5];
diff --git a/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs b/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs
index 05dffe91680..94c7c2b13ce 100644
--- a/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs
+++ b/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs
@@ -11,7 +11,7 @@
 
 fn want_slice(v: &[int]) -> int {
     let mut sum = 0;
-    for i in v.iter() { sum += *i; }
+    for i in v { sum += *i; }
     sum
 }
 
diff --git a/src/test/run-pass/break.rs b/src/test/run-pass/break.rs
index bcfb8f6f914..6498c4b461d 100644
--- a/src/test/run-pass/break.rs
+++ b/src/test/run-pass/break.rs
@@ -15,7 +15,7 @@ pub fn main() {
     loop { i += 1; if i == 20 { break; } }
     assert_eq!(i, 20);
     let xs = [1, 2, 3, 4, 5, 6];
-    for x in xs.iter() {
+    for x in &xs {
         if *x == 3 { break; } assert!((*x <= 3));
     }
     i = 0;
@@ -26,7 +26,7 @@ pub fn main() {
         if i >= 10 { break; }
     }
     let ys = vec!(1, 2, 3, 4, 5, 6);
-    for x in ys.iter() {
+    for x in &ys {
         if *x % 2 == 0 { continue; }
         assert!((*x % 2 != 0));
     }
diff --git a/src/test/run-pass/capture-clauses-boxed-closures.rs b/src/test/run-pass/capture-clauses-boxed-closures.rs
index 6e8ed4fd5a1..5e696566bfa 100644
--- a/src/test/run-pass/capture-clauses-boxed-closures.rs
+++ b/src/test/run-pass/capture-clauses-boxed-closures.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn each<T, F>(x: &[T], mut f: F) where F: FnMut(&T) {
-    for val in x.iter() {
+    for val in x {
         f(val)
     }
 }
diff --git a/src/test/run-pass/capture-clauses-unboxed-closures.rs b/src/test/run-pass/capture-clauses-unboxed-closures.rs
index cd40e2a7843..de1196e10d8 100644
--- a/src/test/run-pass/capture-clauses-unboxed-closures.rs
+++ b/src/test/run-pass/capture-clauses-unboxed-closures.rs
@@ -11,7 +11,7 @@
 #![feature(unboxed_closures)]
 
 fn each<'a,T,F:FnMut(&'a T)>(x: &'a [T], mut f: F) {
-    for val in x.iter() {
+    for val in x {
         f(val)
     }
 }
diff --git a/src/test/run-pass/cleanup-rvalue-for-scope.rs b/src/test/run-pass/cleanup-rvalue-for-scope.rs
index 8969cca2610..f69a0332cc4 100644
--- a/src/test/run-pass/cleanup-rvalue-for-scope.rs
+++ b/src/test/run-pass/cleanup-rvalue-for-scope.rs
@@ -61,7 +61,7 @@ impl Drop for AddFlags {
 pub fn main() {
     // The array containing [AddFlags] should not be dropped until
     // after the for loop:
-    for x in [AddFlags(1)].iter() {
+    for x in &[AddFlags(1)] {
         check_flags(0);
     }
     check_flags(1);
diff --git a/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs b/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs
index f6abfda03e3..b6b30e2fe9b 100644
--- a/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs
+++ b/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs
@@ -10,7 +10,7 @@
 
 fn sum(x: &[int]) -> int {
     let mut sum = 0;
-    for y in x.iter() { sum += *y; }
+    for y in x { sum += *y; }
     return sum;
 }
 
diff --git a/src/test/run-pass/const-vec-of-fns.rs b/src/test/run-pass/const-vec-of-fns.rs
index f21f7d1903c..0914402256d 100644
--- a/src/test/run-pass/const-vec-of-fns.rs
+++ b/src/test/run-pass/const-vec-of-fns.rs
@@ -22,7 +22,7 @@ static mut closures: &'static mut [S<fn()>] = &mut [S(f as fn()), S(f as fn())];
 
 pub fn main() {
     unsafe {
-        for &bare_fn in bare_fns.iter() { bare_fn() }
+        for &bare_fn in bare_fns { bare_fn() }
         for closure in closures.iter_mut() {
             let S(ref mut closure) = *closure;
             (*closure)()
diff --git a/src/test/run-pass/explicit-self-closures.rs b/src/test/run-pass/explicit-self-closures.rs
index c7e5681c0c1..ef9dc377bc7 100644
--- a/src/test/run-pass/explicit-self-closures.rs
+++ b/src/test/run-pass/explicit-self-closures.rs
@@ -16,7 +16,7 @@ struct Box {
 
 impl Box {
     pub fn set_many(&mut self, xs: &[uint]) {
-        for x in xs.iter() { self.x = *x; }
+        for x in xs { self.x = *x; }
     }
 }
 
diff --git a/src/test/run-pass/fn-pattern-expected-type-2.rs b/src/test/run-pass/fn-pattern-expected-type-2.rs
index 8590c8b90b2..4e2c8facaf8 100644
--- a/src/test/run-pass/fn-pattern-expected-type-2.rs
+++ b/src/test/run-pass/fn-pattern-expected-type-2.rs
@@ -10,7 +10,7 @@
 
 pub fn main() {
     let v : &[(int,int)] = &[ (1, 2), (3, 4), (5, 6) ];
-    for &(x, y) in v.iter() {
+    for &(x, y) in v {
         println!("{}", y);
         println!("{}", x);
     }
diff --git a/src/test/run-pass/for-destruct.rs b/src/test/run-pass/for-destruct.rs
index 7cc8b22e061..7a9b8a45b2a 100644
--- a/src/test/run-pass/for-destruct.rs
+++ b/src/test/run-pass/for-destruct.rs
@@ -11,7 +11,7 @@
 struct Pair { x: int, y: int }
 
 pub fn main() {
-    for elt in (vec!(Pair {x: 10, y: 20}, Pair {x: 30, y: 0})).iter() {
+    for elt in &(vec!(Pair {x: 10, y: 20}, Pair {x: 30, y: 0})) {
         assert_eq!(elt.x + elt.y, 30);
     }
 }
diff --git a/src/test/run-pass/for-loop-goofiness.rs b/src/test/run-pass/for-loop-goofiness.rs
index ae509dc0862..7754751120e 100644
--- a/src/test/run-pass/for-loop-goofiness.rs
+++ b/src/test/run-pass/for-loop-goofiness.rs
@@ -17,7 +17,7 @@ type Iterator = int;
 
 pub fn main() {
     let x = [ 3, 3, 3 ];
-    for i in x.iter() {
+    for i in &x {
         assert_eq!(*i, 3);
     }
 }
diff --git a/src/test/run-pass/for-loop-panic.rs b/src/test/run-pass/for-loop-panic.rs
index d157da3139f..d2de1ed8c7e 100644
--- a/src/test/run-pass/for-loop-panic.rs
+++ b/src/test/run-pass/for-loop-panic.rs
@@ -9,4 +9,4 @@
 // except according to those terms.
 
 
-pub fn main() { let x: Vec<int> = Vec::new(); for _ in x.iter() { panic!("moop"); } }
+pub fn main() { let x: Vec<int> = Vec::new(); for _ in &x { panic!("moop"); } }
diff --git a/src/test/run-pass/foreach-external-iterators-break.rs b/src/test/run-pass/foreach-external-iterators-break.rs
index 9cbb4f4107a..e9e8c3f0929 100644
--- a/src/test/run-pass/foreach-external-iterators-break.rs
+++ b/src/test/run-pass/foreach-external-iterators-break.rs
@@ -11,7 +11,7 @@
 pub fn main() {
     let x = [1; 100];
     let mut y = 0;
-    for i in x.iter() {
+    for i in &x[] {
         if y > 10 {
             break;
         }
diff --git a/src/test/run-pass/foreach-external-iterators-hashmap-break-restart.rs b/src/test/run-pass/foreach-external-iterators-hashmap-break-restart.rs
index 891cbf6696b..a4988bf016c 100644
--- a/src/test/run-pass/foreach-external-iterators-hashmap-break-restart.rs
+++ b/src/test/run-pass/foreach-external-iterators-hashmap-break-restart.rs
@@ -19,7 +19,7 @@ use std::collections::HashMap;
 pub fn main() {
     let mut h = HashMap::new();
     let kvs = [(1, 10), (2, 20), (3, 30)];
-    for &(k,v) in kvs.iter() {
+    for &(k,v) in &kvs {
         h.insert(k,v);
     }
     let mut x = 0;
diff --git a/src/test/run-pass/foreach-external-iterators-hashmap.rs b/src/test/run-pass/foreach-external-iterators-hashmap.rs
index 1878997de5a..ed4328d94fe 100644
--- a/src/test/run-pass/foreach-external-iterators-hashmap.rs
+++ b/src/test/run-pass/foreach-external-iterators-hashmap.rs
@@ -15,12 +15,12 @@ use std::collections::HashMap;
 pub fn main() {
     let mut h = HashMap::new();
     let kvs = [(1, 10), (2, 20), (3, 30)];
-    for &(k,v) in kvs.iter() {
+    for &(k,v) in &kvs {
         h.insert(k,v);
     }
     let mut x = 0;
     let mut y = 0;
-    for (&k,&v) in h.iter() {
+    for (&k,&v) in &h {
         x += k;
         y += v;
     }
diff --git a/src/test/run-pass/foreach-external-iterators-nested.rs b/src/test/run-pass/foreach-external-iterators-nested.rs
index 75471991620..6acfbc95317 100644
--- a/src/test/run-pass/foreach-external-iterators-nested.rs
+++ b/src/test/run-pass/foreach-external-iterators-nested.rs
@@ -13,8 +13,8 @@ pub fn main() {
     let y = [2; 100];
     let mut p = 0;
     let mut q = 0;
-    for i in x.iter() {
-        for j in y.iter() {
+    for i in &x[] {
+        for j in &y[] {
             p += *j;
         }
         q += *i + p;
diff --git a/src/test/run-pass/foreach-external-iterators.rs b/src/test/run-pass/foreach-external-iterators.rs
index ef4692b2b51..2f154be659d 100644
--- a/src/test/run-pass/foreach-external-iterators.rs
+++ b/src/test/run-pass/foreach-external-iterators.rs
@@ -11,7 +11,7 @@
 pub fn main() {
     let x = [1; 100];
     let mut y = 0;
-    for i in x.iter() {
+    for i in &x[] {
         y += *i
     }
     assert!(y == 100);
diff --git a/src/test/run-pass/generic-static-methods.rs b/src/test/run-pass/generic-static-methods.rs
index 90a6349385d..7f84efcdd5d 100644
--- a/src/test/run-pass/generic-static-methods.rs
+++ b/src/test/run-pass/generic-static-methods.rs
@@ -16,7 +16,7 @@ trait vec_utils<T> {
 impl<T> vec_utils<T> for Vec<T> {
     fn map_<U, F>(x: &Vec<T> , mut f: F) -> Vec<U> where F: FnMut(&T) -> U {
         let mut r = Vec::new();
-        for elt in x.iter() {
+        for elt in x {
             r.push(f(elt));
         }
         r
diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs
index 0e82ad43782..651ac632439 100644
--- a/src/test/run-pass/hashmap-memory.rs
+++ b/src/test/run-pass/hashmap-memory.rs
@@ -35,7 +35,7 @@ mod map_reduce {
     enum ctrl_proto { find_reducer(Vec<u8>, Sender<int>), mapper_done, }
 
     fn start_mappers(ctrl: Sender<ctrl_proto>, inputs: Vec<String>) {
-        for i in inputs.iter() {
+        for i in &inputs {
             let ctrl = ctrl.clone();
             let i = i.clone();
             Thread::spawn(move|| map_task(ctrl.clone(), i.clone()) );
diff --git a/src/test/run-pass/issue-10396.rs b/src/test/run-pass/issue-10396.rs
index 7095812ce4b..b487608d4e6 100644
--- a/src/test/run-pass/issue-10396.rs
+++ b/src/test/run-pass/issue-10396.rs
@@ -14,7 +14,7 @@ enum Foo<'s> {
 }
 
 fn f(arr: &[&Foo]) {
-    for &f in arr.iter() {
+    for &f in arr {
         println!("{:?}", f);
     }
 }
diff --git a/src/test/run-pass/issue-17068.rs b/src/test/run-pass/issue-17068.rs
index dfbe7406229..a0e6f2c9be9 100644
--- a/src/test/run-pass/issue-17068.rs
+++ b/src/test/run-pass/issue-17068.rs
@@ -11,7 +11,7 @@
 // Test that regionck creates the right region links in the pattern
 // binding of a for loop
 fn foo<'a>(v: &'a [uint]) -> &'a uint {
-    for &ref x in v.iter() { return x; }
+    for &ref x in v { return x; }
     unreachable!()
 }
 
diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs
index 8a67d84cb64..b55f3691358 100644
--- a/src/test/run-pass/issue-2904.rs
+++ b/src/test/run-pass/issue-2904.rs
@@ -66,12 +66,12 @@ fn read_board_grid<rdr:'static + old_io::Reader>(mut input: rdr)
     let mut line = [0; 10];
     input.read(&mut line);
     let mut row = Vec::new();
-    for c in line.iter() {
+    for c in &line {
         row.push(square_from_char(*c as char))
     }
     grid.push(row);
     let width = grid[0].len();
-    for row in grid.iter() { assert!(row.len() == width) }
+    for row in &grid { assert!(row.len() == width) }
     grid
 }
 
diff --git a/src/test/run-pass/issue-3389.rs b/src/test/run-pass/issue-3389.rs
index 8f6b8137199..26558bdd30c 100644
--- a/src/test/run-pass/issue-3389.rs
+++ b/src/test/run-pass/issue-3389.rs
@@ -15,7 +15,7 @@ struct trie_node {
 }
 
 fn print_str_vector(vector: Vec<String> ) {
-    for string in vector.iter() {
+    for string in &vector {
         println!("{}", *string);
     }
 }
diff --git a/src/test/run-pass/issue-3563-2.rs b/src/test/run-pass/issue-3563-2.rs
index e688b95f873..2cf29296b85 100644
--- a/src/test/run-pass/issue-3563-2.rs
+++ b/src/test/run-pass/issue-3563-2.rs
@@ -11,7 +11,7 @@
 trait Canvas {
     fn add_point(&self, point: &int);
     fn add_points(&self, shapes: &[int]) {
-        for pt in shapes.iter() {
+        for pt in shapes {
             self.add_point(pt)
         }
     }
diff --git a/src/test/run-pass/issue-3563-3.rs b/src/test/run-pass/issue-3563-3.rs
index 426a8ccf7e7..5d02a1b2bd2 100644
--- a/src/test/run-pass/issue-3563-3.rs
+++ b/src/test/run-pass/issue-3563-3.rs
@@ -122,7 +122,7 @@ trait Canvas {
     // Unlike interfaces traits support default implementations.
     // Got an ICE as soon as I added this method.
     fn add_points(&mut self, shapes: &[Point]) {
-        for pt in shapes.iter() {self.add_point(*pt)};
+        for pt in shapes {self.add_point(*pt)};
     }
 }
 
diff --git a/src/test/run-pass/issue-4241.rs b/src/test/run-pass/issue-4241.rs
index 19622cb88e3..89cf2f69b34 100644
--- a/src/test/run-pass/issue-4241.rs
+++ b/src/test/run-pass/issue-4241.rs
@@ -100,7 +100,7 @@ priv fn cmd_to_string(cmd: ~[String]) -> String {
   let mut res = "*".to_string();
   res.push_str(cmd.len().to_string());
   res.push_str("\r\n");
-    for s in cmd.iter() {
+    for s in &cmd {
     res.push_str(["$".to_string(), s.len().to_string(), "\r\n".to_string(),
                   (*s).clone(), "\r\n".to_string()].concat() );
     }
diff --git a/src/test/run-pass/issue-4542.rs b/src/test/run-pass/issue-4542.rs
index 024ee8c6dfe..ae72de50d26 100644
--- a/src/test/run-pass/issue-4542.rs
+++ b/src/test/run-pass/issue-4542.rs
@@ -11,7 +11,7 @@
 use std::os;
 
 pub fn main() {
-    for arg in os::args().iter() {
+    for arg in &os::args() {
         match (*arg).clone() {
             _s => { }
         }
diff --git a/src/test/run-pass/issue-5666.rs b/src/test/run-pass/issue-5666.rs
index e53f4c86923..4f304e3b436 100644
--- a/src/test/run-pass/issue-5666.rs
+++ b/src/test/run-pass/issue-5666.rs
@@ -31,7 +31,7 @@ pub fn main() {
     let bubbles = box Dog{name: "bubbles".to_string()};
     let barker = [snoopy as Box<Barks>, bubbles as Box<Barks>];
 
-    for pup in barker.iter() {
+    for pup in &barker {
         println!("{}", pup.bark());
     }
 }
diff --git a/src/test/run-pass/issue-5688.rs b/src/test/run-pass/issue-5688.rs
index a4f39884846..9612c4bf181 100644
--- a/src/test/run-pass/issue-5688.rs
+++ b/src/test/run-pass/issue-5688.rs
@@ -23,7 +23,7 @@ struct X { vec: &'static [int] }
 static V: &'static [X] = &[X { vec: &[1, 2, 3] }];
 
 pub fn main() {
-    for &v in V.iter() {
+    for &v in V {
         println!("{:?}", v.vec);
     }
 }
diff --git a/src/test/run-pass/linear-for-loop.rs b/src/test/run-pass/linear-for-loop.rs
index eda14222e91..22a29279a67 100644
--- a/src/test/run-pass/linear-for-loop.rs
+++ b/src/test/run-pass/linear-for-loop.rs
@@ -13,7 +13,7 @@
 pub fn main() {
     let x = vec!(1, 2, 3);
     let mut y = 0;
-    for i in x.iter() { println!("{}", *i); y += *i; }
+    for i in &x { println!("{}", *i); y += *i; }
     println!("{}", y);
     assert_eq!(y, 6);
     let s = "hello there".to_string();
diff --git a/src/test/run-pass/loop-label-shadowing.rs b/src/test/run-pass/loop-label-shadowing.rs
index cfe51fe7758..686a9a002ce 100644
--- a/src/test/run-pass/loop-label-shadowing.rs
+++ b/src/test/run-pass/loop-label-shadowing.rs
@@ -12,7 +12,7 @@
 
 fn main() {
     let mut foo = Vec::new();
-    'foo: for i in [1, 2, 3].iter() {
+    'foo: for i in &[1, 2, 3] {
         foo.push(i);
     }
 }
diff --git a/src/test/run-pass/loop-scope.rs b/src/test/run-pass/loop-scope.rs
index 1dc3700194c..88711a46059 100644
--- a/src/test/run-pass/loop-scope.rs
+++ b/src/test/run-pass/loop-scope.rs
@@ -11,6 +11,6 @@
 pub fn main() {
     let x = vec!(10, 20, 30);
     let mut sum = 0;
-    for x in x.iter() { sum += *x; }
+    for x in &x { sum += *x; }
     assert_eq!(sum, 60);
 }
diff --git a/src/test/run-pass/monad.rs b/src/test/run-pass/monad.rs
index acd8078b1f4..457c0a35fd7 100644
--- a/src/test/run-pass/monad.rs
+++ b/src/test/run-pass/monad.rs
@@ -17,7 +17,7 @@ trait vec_monad<A> {
 impl<A> vec_monad<A> for Vec<A> {
     fn bind<B, F>(&self, mut f: F) -> Vec<B> where F: FnMut(&A) -> Vec<B> {
         let mut r = Vec::new();
-        for elt in self.iter() {
+        for elt in self {
             r.extend(f(elt).into_iter());
         }
         r
diff --git a/src/test/run-pass/mutability-inherits-through-fixed-length-vec.rs b/src/test/run-pass/mutability-inherits-through-fixed-length-vec.rs
index 7d6bbbe4240..36a41896bcd 100644
--- a/src/test/run-pass/mutability-inherits-through-fixed-length-vec.rs
+++ b/src/test/run-pass/mutability-inherits-through-fixed-length-vec.rs
@@ -17,7 +17,7 @@ fn test1() {
 fn test2() {
     let mut ints = [0; 32];
     for i in ints.iter_mut() { *i += 22; }
-    for i in ints.iter() { assert!(*i == 22); }
+    for i in &ints { assert!(*i == 22); }
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/overloaded-index-assoc-list.rs b/src/test/run-pass/overloaded-index-assoc-list.rs
index 7e3ff198c43..0064748e883 100644
--- a/src/test/run-pass/overloaded-index-assoc-list.rs
+++ b/src/test/run-pass/overloaded-index-assoc-list.rs
@@ -32,7 +32,7 @@ impl<K: PartialEq + std::fmt::Debug, V:Clone> Index<K> for AssociationList<K,V>
     type Output = V;
 
     fn index<'a>(&'a self, index: &K) -> &'a V {
-        for pair in self.pairs.iter() {
+        for pair in &self.pairs {
             if pair.key == *index {
                 return &pair.value
             }
diff --git a/src/test/run-pass/packed-struct-vec.rs b/src/test/run-pass/packed-struct-vec.rs
index 847688ce045..ede94acd934 100644
--- a/src/test/run-pass/packed-struct-vec.rs
+++ b/src/test/run-pass/packed-struct-vec.rs
@@ -28,7 +28,7 @@ pub fn main() {
         assert_eq!(foos[i], Foo { bar: 1, baz: 2});
     }
 
-    for &foo in foos.iter() {
+    for &foo in &foos {
         assert_eq!(foo, Foo { bar: 1, baz: 2 });
     }
 }
diff --git a/src/test/run-pass/regions-mock-tcx.rs b/src/test/run-pass/regions-mock-tcx.rs
index 34ff7acfca4..be7db25201a 100644
--- a/src/test/run-pass/regions-mock-tcx.rs
+++ b/src/test/run-pass/regions-mock-tcx.rs
@@ -66,7 +66,7 @@ impl<'tcx,'ast> TypeContext<'tcx, 'ast> {
     }
 
     fn add_type(&mut self, s: TypeStructure<'tcx>) -> Type<'tcx> {
-        for &ty in self.types.iter() {
+        for &ty in &self.types {
             if *ty == s {
                 return ty;
             }
diff --git a/src/test/run-pass/repeated-vector-syntax.rs b/src/test/run-pass/repeated-vector-syntax.rs
index 6048e0d8673..6a1384ff933 100644
--- a/src/test/run-pass/repeated-vector-syntax.rs
+++ b/src/test/run-pass/repeated-vector-syntax.rs
@@ -13,7 +13,7 @@ pub fn main() {
     let y = [ 0; 1 ];
 
     print!("[");
-    for xi in x.iter() {
+    for xi in &x[] {
         print!("{:?}, ", &xi[]);
     }
     println!("]");
diff --git a/src/test/run-pass/shadow.rs b/src/test/run-pass/shadow.rs
index dbe73d1b94a..6e03c1e4a80 100644
--- a/src/test/run-pass/shadow.rs
+++ b/src/test/run-pass/shadow.rs
@@ -15,7 +15,7 @@ fn foo(c: Vec<int> ) {
 
     match t::none::<int> {
         t::some::<int>(_) => {
-            for _i in c.iter() {
+            for _i in &c {
                 println!("{}", a);
                 let a = 17;
                 b.push(a);
diff --git a/src/test/run-pass/static-impl.rs b/src/test/run-pass/static-impl.rs
index 44d77e440d1..ff37ccb81ed 100644
--- a/src/test/run-pass/static-impl.rs
+++ b/src/test/run-pass/static-impl.rs
@@ -47,10 +47,10 @@ trait vec_utils<T> {
 
 impl<T> vec_utils<T> for Vec<T> {
     fn length_(&self) -> uint { self.len() }
-    fn iter_<F>(&self, mut f: F) where F: FnMut(&T) { for x in self.iter() { f(x); } }
+    fn iter_<F>(&self, mut f: F) where F: FnMut(&T) { for x in self { f(x); } }
     fn map_<U, F>(&self, mut f: F) -> Vec<U> where F: FnMut(&T) -> U {
         let mut r = Vec::new();
-        for elt in self.iter() {
+        for elt in self {
             r.push(f(elt));
         }
         r
diff --git a/src/test/run-pass/task-comm-3.rs b/src/test/run-pass/task-comm-3.rs
index 306cc0ffcef..4aec3d608ac 100644
--- a/src/test/run-pass/task-comm-3.rs
+++ b/src/test/run-pass/task-comm-3.rs
@@ -51,7 +51,7 @@ fn test00() {
 
     // Read from spawned tasks...
     let mut sum = 0;
-    for _r in results.iter() {
+    for _r in &results {
         i = 0;
         while i < number_of_messages {
             let value = rx.recv().unwrap();
diff --git a/src/test/run-pass/trait-bounds-in-arc.rs b/src/test/run-pass/trait-bounds-in-arc.rs
index 0089646d0a1..0b650d97e4f 100644
--- a/src/test/run-pass/trait-bounds-in-arc.rs
+++ b/src/test/run-pass/trait-bounds-in-arc.rs
@@ -97,20 +97,20 @@ pub fn main() {
 
 fn check_legs(arc: Arc<Vec<Box<Pet+Sync+Send>>>) {
     let mut legs = 0;
-    for pet in arc.iter() {
+    for pet in &*arc {
         legs += pet.num_legs();
     }
     assert!(legs == 12);
 }
 fn check_names(arc: Arc<Vec<Box<Pet+Sync+Send>>>) {
-    for pet in arc.iter() {
+    for pet in &*arc {
         pet.name(box |name| {
             assert!(name.as_bytes()[0] == 'a' as u8 && name.as_bytes()[1] == 'l' as u8);
         })
     }
 }
 fn check_pedigree(arc: Arc<Vec<Box<Pet+Sync+Send>>>) {
-    for pet in arc.iter() {
+    for pet in &*arc {
         assert!(pet.of_good_pedigree());
     }
 }
diff --git a/src/test/run-pass/trait-generic.rs b/src/test/run-pass/trait-generic.rs
index e79b22f70cf..5f4b18df6e1 100644
--- a/src/test/run-pass/trait-generic.rs
+++ b/src/test/run-pass/trait-generic.rs
@@ -29,7 +29,7 @@ trait map<T> {
 impl<T> map<T> for Vec<T> {
     fn map<U, F>(&self, mut f: F) -> Vec<U> where F: FnMut(&T) -> U {
         let mut r = Vec::new();
-        for i in self.iter() {
+        for i in self {
             r.push(f(i));
         }
         r
diff --git a/src/test/run-pass/vector-sort-panic-safe.rs b/src/test/run-pass/vector-sort-panic-safe.rs
index aaefbc42d70..9d83c0b0079 100644
--- a/src/test/run-pass/vector-sort-panic-safe.rs
+++ b/src/test/run-pass/vector-sort-panic-safe.rs
@@ -73,7 +73,7 @@ pub fn main() {
             // ... and then panic on each and every single one.
             for panic_countdown in 0..count {
                 // refresh the counters.
-                for c in drop_counts.iter() {
+                for c in &drop_counts {
                     c.store(0, Ordering::Relaxed);
                 }