about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-09-10 18:28:00 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-09-10 18:28:47 -0700
commitf8b3eaae820f87a5d51fe382aef5e9f8256beb29 (patch)
treee3a4c5aa467410f26eb249d26aaa8899383d3b3a /src/libsyntax/ext
parent6957af770bb92b71485f852beb9071733e5f178b (diff)
downloadrust-f8b3eaae820f87a5d51fe382aef5e9f8256beb29.tar.gz
rust-f8b3eaae820f87a5d51fe382aef5e9f8256beb29.zip
Make all moves explicit in libsyntax
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/base.rs4
-rw-r--r--src/libsyntax/ext/pipes/liveness.rs2
-rw-r--r--src/libsyntax/ext/pipes/proto.rs2
-rw-r--r--src/libsyntax/ext/simplext.rs2
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs29
5 files changed, 21 insertions, 18 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index e1114ce8e2a..6de6be82ae2 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -222,14 +222,14 @@ fn mk_ctxt(parse_sess: parse::parse_sess,
             self.parse_sess.interner.intern(@st)
         }
     }
-    let imp : ctxt_repr = {
+    let imp: ctxt_repr = {
         parse_sess: parse_sess,
         cfg: cfg,
         mut backtrace: None,
         mut mod_path: ~[],
         mut trace_mac: false
     };
-    return imp as ext_ctxt
+    move (imp as ext_ctxt)
 }
 
 fn expr_to_str(cx: ext_ctxt, expr: @ast::expr, error: ~str) -> ~str {
diff --git a/src/libsyntax/ext/pipes/liveness.rs b/src/libsyntax/ext/pipes/liveness.rs
index fa0ab0f4c0b..8b17ffc1104 100644
--- a/src/libsyntax/ext/pipes/liveness.rs
+++ b/src/libsyntax/ext/pipes/liveness.rs
@@ -39,7 +39,7 @@ fn analyze(proto: protocol, _cx: ext_ctxt) {
         for state.reachable |s| {
             bv.set(s.id, true);
         }
-        bv
+        move bv
     };
 
     let mut i = 0;
diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs
index 1f674bb5395..373f16daeb0 100644
--- a/src/libsyntax/ext/pipes/proto.rs
+++ b/src/libsyntax/ext/pipes/proto.rs
@@ -188,7 +188,7 @@ impl protocol {
             span: self.span,
             dir: dir,
             ty_params: ty_params,
-            messages: messages,
+            messages: move messages,
             proto: self
         });
 
diff --git a/src/libsyntax/ext/simplext.rs b/src/libsyntax/ext/simplext.rs
index 56fbb3bb074..08fa427d078 100644
--- a/src/libsyntax/ext/simplext.rs
+++ b/src/libsyntax/ext/simplext.rs
@@ -143,7 +143,7 @@ fn pattern_to_selectors(cx: ext_ctxt, e: @expr) -> binders {
         return Some(leaf(m));
     }
     p_t_s_rec(cx, match_expr(e), trivial_selector, res);
-    return res;
+    move res
 }
 
 
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index f32c23c936f..799457381d5 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -255,8 +255,8 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher])
                                                          sp.hi)));
                         }
 
-                        new_pos.idx += 1u;
-                        vec::push(cur_eis, new_pos);
+                        new_pos.idx += 1;
+                        vec::push(cur_eis, move new_pos);
                     }
 
                     // can we go around again?
@@ -266,18 +266,18 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher])
                       Some(t) if idx == len => { // we need a separator
                         if tok == t { //pass the separator
                             let ei_t <- ei;
-                            ei_t.idx += 1u;
-                            vec::push(next_eis, ei_t);
+                            ei_t.idx += 1;
+                            vec::push(next_eis, move ei_t);
                         }
                       }
                       _ => { // we don't need a separator
                         let ei_t <- ei;
-                        ei_t.idx = 0u;
-                        vec::push(cur_eis, ei_t);
+                        ei_t.idx = 0;
+                        vec::push(cur_eis, move ei_t);
                       }
                     }
                 } else {
-                    vec::push(eof_eis, ei);
+                    vec::push(eof_eis, move ei);
                 }
             } else {
                 match copy ei.elts[idx].node {
@@ -292,7 +292,7 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher])
                             new_ei.matches[idx].push(@matched_seq(~[], sp));
                         }
 
-                        vec::push(cur_eis, new_ei);
+                        vec::push(cur_eis, move new_ei);
                     }
 
                     let matches = vec::map(ei.matches, // fresh, same size:
@@ -300,16 +300,19 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher])
                     let ei_t <- ei;
                     vec::push(cur_eis, ~{
                         elts: matchers, sep: sep, mut idx: 0u,
-                        mut up: matcher_pos_up(Some(ei_t)),
-                        matches: matches,
+                        mut up: matcher_pos_up(Some(move ei_t)),
+                        matches: move matches,
                         match_lo: match_idx_lo, match_hi: match_idx_hi,
                         sp_lo: sp.lo
                     });
                   }
-                  match_nonterminal(_,_,_) => { vec::push(bb_eis, ei) }
+                  match_nonterminal(_,_,_) => { vec::push(bb_eis, move ei) }
                   match_tok(t) => {
                     let ei_t <- ei;
-                    if t == tok { ei_t.idx += 1u; vec::push(next_eis, ei_t)}
+                    if t == tok {
+                        ei_t.idx += 1;
+                        vec::push(next_eis, move ei_t);
+                    }
                   }
                 }
             }
@@ -362,7 +365,7 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher])
                   }
                   _ => fail
                 }
-                vec::push(cur_eis,ei);
+                vec::push(cur_eis, move ei);
 
                 /* this would fail if zero-length tokens existed */
                 while rdr.peek().sp.lo < rust_parser.span.lo {