about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-06-07 14:43:02 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-06-07 14:43:02 -0400
commitd945543ebf446913a44375169aa23686ffaa6205 (patch)
tree5ffb15c6376e9a94ffa98fa81ffb8382b79b57e3 /src/libsyntax
parent18019a1304c5cf6ec6f04e43b030602c8fec0e01 (diff)
parent54d914a9a932a0e9e65195f0f5be91e5e8b7f342 (diff)
downloadrust-d945543ebf446913a44375169aa23686ffaa6205.tar.gz
rust-d945543ebf446913a44375169aa23686ffaa6205.zip
Merge branch 'each-fn-kill' of https://github.com/huonw/rust into each-fn-kill
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/deriving/generic.rs5
-rw-r--r--src/libsyntax/ext/pipes/pipec.rs4
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs3
3 files changed, 7 insertions, 5 deletions
diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs
index 52a2d9ff9de..b36d4496492 100644
--- a/src/libsyntax/ext/deriving/generic.rs
+++ b/src/libsyntax/ext/deriving/generic.rs
@@ -174,6 +174,7 @@ use opt_vec;
 
 use core::uint;
 use core::vec;
+use core::iterator::IteratorUtil;
 
 pub use self::ty::*;
 mod ty;
@@ -616,7 +617,7 @@ impl<'self> MethodDef<'self> {
         // make a series of nested matches, to destructure the
         // structs. This is actually right-to-left, but it shoudn't
         // matter.
-        for vec::each2(self_args, patterns) |&arg_expr, &pat| {
+        for self_args.iter().zip(patterns.iter()).advance |(&arg_expr, &pat)| {
             body = cx.expr_match(span, arg_expr,
                                  ~[ cx.arm(span, ~[pat], body) ])
         }
@@ -951,7 +952,7 @@ fn create_struct_pattern(cx: @ExtCtxt,
     // must be nonempty to reach here
     let pattern = if struct_type == Record {
         let field_pats = do vec::build |push| {
-            for vec::each2(subpats, ident_expr) |&pat, &(id, _)| {
+            for subpats.iter().zip(ident_expr.iter()).advance |(&pat, &(id, _))| {
                 // id is guaranteed to be Some
                 push(ast::field_pat { ident: id.get(), pat: pat })
             }
diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs
index 1e5b3c3ee7e..a5725613d58 100644
--- a/src/libsyntax/ext/pipes/pipec.rs
+++ b/src/libsyntax/ext/pipes/pipec.rs
@@ -23,6 +23,7 @@ use ext::quote::rt::*;
 use opt_vec;
 use opt_vec::OptVec;
 
+use core::iterator::IteratorUtil;
 use core::str;
 use core::vec;
 
@@ -258,8 +259,7 @@ impl to_type_decls for state {
         let mut items = ~[];
 
         {
-            let messages = &mut *self.messages;
-            for vec::each_mut(*messages) |m| {
+            for self.messages.mut_iter().advance |m| {
                 if dir == send {
                     items.push(m.gen_send(cx, true));
                     items.push(m.gen_send(cx, false));
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index 9fb9def84e9..5f43452cc83 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -22,6 +22,7 @@ use parse::parser::Parser;
 use parse::token::{Token, EOF, to_str, nonterminal, get_ident_interner, ident_to_str};
 use parse::token;
 
+use core::iterator::IteratorUtil;
 use core::hashmap::HashMap;
 use core::str;
 use core::uint;
@@ -358,7 +359,7 @@ pub fn parse(
         if tok == EOF {
             if eof_eis.len() == 1u {
                 let mut v = ~[];
-                for vec::each_mut(eof_eis[0u].matches) |dv| {
+                for eof_eis[0u].matches.mut_iter().advance |dv| {
                     v.push(dv.pop());
                 }
                 return success(nameize(sess, ms, v));