summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-09-19 16:55:01 -0700
committerNiko Matsakis <niko@alum.mit.edu>2012-09-19 17:03:01 -0700
commitcfed923600e2f7ad34241501200d595abccdeb54 (patch)
treed382eb144026703d9abee0e6a99b87b34e9bd138 /src/libsyntax/ext
parent1c39f1968c77a3d42b0fdb30a36cff4d94a17da2 (diff)
downloadrust-cfed923600e2f7ad34241501200d595abccdeb54.tar.gz
rust-cfed923600e2f7ad34241501200d595abccdeb54.zip
demode the each() method on vec and other iterables.
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/concat_idents.rs2
-rw-r--r--src/libsyntax/ext/fmt.rs8
-rw-r--r--src/libsyntax/ext/pipes/pipec.rs6
-rw-r--r--src/libsyntax/ext/pipes/proto.rs2
-rw-r--r--src/libsyntax/ext/simplext.rs4
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs4
6 files changed, 13 insertions, 13 deletions
diff --git a/src/libsyntax/ext/concat_idents.rs b/src/libsyntax/ext/concat_idents.rs
index 45e6bf43f4b..94b22d68cea 100644
--- a/src/libsyntax/ext/concat_idents.rs
+++ b/src/libsyntax/ext/concat_idents.rs
@@ -6,7 +6,7 @@ fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, arg: ast::mac_arg,
     let mut res_str = ~"";
     for args.each |e| {
         res_str += *cx.parse_sess().interner.get(
-            expr_to_ident(cx, e, ~"expected an ident"));
+            expr_to_ident(cx, *e, ~"expected an ident"));
     }
     let res = cx.parse_sess().interner.intern(@res_str);
 
diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs
index 4c5435d1123..3ea0493239f 100644
--- a/src/libsyntax/ext/fmt.rs
+++ b/src/libsyntax/ext/fmt.rs
@@ -53,7 +53,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span,
         fn make_flags(cx: ext_ctxt, sp: span, flags: ~[Flag]) -> @ast::expr {
             let mut tmp_expr = make_rt_path_expr(cx, sp, @~"flag_none");
             for flags.each |f| {
-                let fstr = match f {
+                let fstr = match *f {
                   FlagLeftJustify => ~"flag_left_justify",
                   FlagLeftZeroPad => ~"flag_left_zero_pad",
                   FlagSpaceForSign => ~"flag_space_for_sign",
@@ -139,7 +139,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span,
           _ => cx.span_unimpl(sp, unsupported)
         }
         for cnv.flags.each |f| {
-            match f {
+            match *f {
               FlagLeftJustify => (),
               FlagSignAlways => {
                 if !is_signed_type(cnv) {
@@ -196,7 +196,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span,
           _ => debug!("param: none")
         }
         for c.flags.each |f| {
-            match f {
+            match *f {
               FlagLeftJustify => debug!("flag: left justify"),
               FlagLeftZeroPad => debug!("flag: left zero pad"),
               FlagSpaceForSign => debug!("flag: left space pad"),
@@ -243,7 +243,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span,
     let mut piece_exprs = ~[];
     let nargs = args.len();
     for pieces.each |pc| {
-        match pc {
+        match *pc {
           PieceString(s) => {
             vec::push(piece_exprs, mk_uniq_str(cx, fmt_sp, s))
           }
diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs
index 600c30f1f8b..e2b08d089a7 100644
--- a/src/libsyntax/ext/pipes/pipec.rs
+++ b/src/libsyntax/ext/pipes/pipec.rs
@@ -202,7 +202,7 @@ impl state: to_type_decls {
         let mut items_msg = ~[];
 
         for self.messages.each |m| {
-            let message(name, span, tys, this, next) = m;
+            let message(name, span, tys, this, next) = *m;
 
             let tys = match next {
               Some({state: next, tys: next_tys}) => {
@@ -366,7 +366,7 @@ impl protocol: gen_init {
         for (copy self.states).each |s| {
             for s.ty_params.each |tp| {
                 match params.find(|tpp| tp.ident == tpp.ident) {
-                  None => vec::push(params, tp),
+                  None => vec::push(params, *tp),
                   _ => ()
                 }
             }
@@ -382,7 +382,7 @@ impl protocol: gen_init {
         let fields = do (copy self.states).map_to_vec |s| {
             for s.ty_params.each |tp| {
                 match params.find(|tpp| tp.ident == tpp.ident) {
-                  None => vec::push(params, tp),
+                  None => vec::push(params, *tp),
                   _ => ()
                 }
             }
diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs
index 373f16daeb0..fec8339cf1a 100644
--- a/src/libsyntax/ext/pipes/proto.rs
+++ b/src/libsyntax/ext/pipes/proto.rs
@@ -102,7 +102,7 @@ impl state {
     /// from this state.
     fn reachable(f: fn(state) -> bool) {
         for self.messages.each |m| {
-            match m {
+            match *m {
               message(_, _, _, _, Some({state: id, _})) => {
                 let state = self.proto.get_state(id);
                 if !f(state) { break }
diff --git a/src/libsyntax/ext/simplext.rs b/src/libsyntax/ext/simplext.rs
index 8c7ef65d227..c9385b0c35c 100644
--- a/src/libsyntax/ext/simplext.rs
+++ b/src/libsyntax/ext/simplext.rs
@@ -92,7 +92,7 @@ fn option_flatten_map<T: Copy, U: Copy>(f: fn@(T) -> Option<U>, v: ~[T]) ->
    Option<~[U]> {
     let mut res = ~[];
     for v.each |elem| {
-        match f(elem) {
+        match f(*elem) {
           None => return None,
           Some(fv) => vec::push(res, fv)
         }
@@ -156,7 +156,7 @@ fn use_selectors_to_bind(b: binders, e: @expr) -> Option<bindings> {
     let res = HashMap();
     //need to do this first, to check vec lengths.
     for b.literal_ast_matchers.each |sel| {
-        match sel(match_expr(e)) { None => return None, _ => () }
+        match (*sel)(match_expr(e)) { None => return None, _ => () }
     }
     let mut never_mind: bool = false;
     for b.real_binders.each |key, val| {
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index c0a8848139f..74c36dcf1b7 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -174,7 +174,7 @@ fn nameize(p_s: parse_sess, ms: ~[matcher], res: ~[@named_match])
         match m {
           {node: match_tok(_), span: _} => (),
           {node: match_seq(more_ms, _, _, _, _), span: _} => {
-            for more_ms.each() |next_m| { n_rec(p_s, next_m, res, ret_val) };
+            for more_ms.each() |next_m| { n_rec(p_s, *next_m, res, ret_val) };
           }
           {node: match_nonterminal(bind_name, _, idx), span: sp} => {
             if ret_val.contains_key(bind_name) {
@@ -186,7 +186,7 @@ fn nameize(p_s: parse_sess, ms: ~[matcher], res: ~[@named_match])
         }
     }
     let ret_val = HashMap::<uint,@named_match>();
-    for ms.each() |m| { n_rec(p_s, m, res, ret_val) }
+    for ms.each() |m| { n_rec(p_s, *m, res, ret_val) }
     return ret_val;
 }