about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libsyntax/ext/auto_encode.rs34
-rw-r--r--src/libsyntax/ext/base.rs15
-rw-r--r--src/libsyntax/ext/build.rs68
-rw-r--r--src/libsyntax/ext/deriving.rs4
-rw-r--r--src/libsyntax/ext/env.rs4
-rw-r--r--src/libsyntax/ext/expand.rs27
-rw-r--r--src/libsyntax/ext/fmt.rs13
-rw-r--r--src/libsyntax/ext/pipes/ast_builder.rs16
-rw-r--r--src/libsyntax/ext/pipes/liveness.rs2
-rw-r--r--src/libsyntax/ext/pipes/mod.rs4
-rw-r--r--src/libsyntax/ext/pipes/parse_proto.rs10
-rw-r--r--src/libsyntax/ext/pipes/pipec.rs8
-rw-r--r--src/libsyntax/ext/pipes/proto.rs8
-rw-r--r--src/libsyntax/ext/quote.rs8
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs13
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs6
-rw-r--r--src/libsyntax/ext/tt/transcribe.rs35
17 files changed, 151 insertions, 124 deletions
diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs
index 27e76a8ce7a..ea8678ed208 100644
--- a/src/libsyntax/ext/auto_encode.rs
+++ b/src/libsyntax/ext/auto_encode.rs
@@ -143,8 +143,8 @@ pub fn expand_auto_encode(
                         cx,
                         item.span,
                         item.ident,
-                        *enum_def,
-                        *tps
+                        copy *enum_def,
+                        copy *tps
                     );
 
                     ~[filter_attrs(*item), ser_impl]
@@ -188,7 +188,7 @@ pub fn expand_auto_decode(
                         item.span,
                         item.ident,
                         struct_def.fields,
-                        *tps
+                        copy *tps
                     );
 
                     ~[filter_attrs(*item), deser_impl]
@@ -198,8 +198,8 @@ pub fn expand_auto_decode(
                         cx,
                         item.span,
                         item.ident,
-                        *enum_def,
-                        *tps
+                        copy *enum_def,
+                        copy *tps
                     );
 
                     ~[filter_attrs(*item), deser_impl]
@@ -346,7 +346,7 @@ priv impl ext_ctxt {
 
     fn lambda(+blk: ast::blk) -> @ast::expr {
         let ext_cx = self;
-        let blk_e = self.expr(blk.span, ast::expr_block(blk));
+        let blk_e = self.expr(copy blk.span, ast::expr_block(copy blk));
         quote_expr!( || $blk_e )
     }
 
@@ -840,14 +840,14 @@ fn mk_enum_ser_impl(
     cx: ext_ctxt,
     span: span,
     ident: ast::ident,
-    enum_def: ast::enum_def,
+    +enum_def: ast::enum_def,
     tps: ~[ast::ty_param]
 ) -> @ast::item {
     let body = mk_enum_ser_body(
         cx,
         span,
         ident,
-        enum_def.variants
+        copy enum_def.variants
     );
 
     mk_ser_impl(cx, span, ident, tps, body)
@@ -857,7 +857,7 @@ fn mk_enum_deser_impl(
     cx: ext_ctxt,
     span: span,
     ident: ast::ident,
-    enum_def: ast::enum_def,
+    +enum_def: ast::enum_def,
     tps: ~[ast::ty_param]
 ) -> @ast::item {
     let body = mk_enum_deser_body(
@@ -960,8 +960,14 @@ fn mk_enum_ser_body(
 ) -> @ast::expr {
     let arms = do variants.mapi |v_idx, variant| {
         match variant.node.kind {
-            ast::tuple_variant_kind(args) =>
-                ser_variant(cx, span, variant.node.name, v_idx, args),
+            ast::tuple_variant_kind(ref args) =>
+                ser_variant(
+                    cx,
+                    span,
+                    variant.node.name,
+                    v_idx,
+                    /*bad*/ copy *args
+                ),
             ast::struct_variant_kind(*) =>
                 fail!(~"struct variants unimplemented"),
             ast::enum_variant_kind(*) =>
@@ -1041,7 +1047,7 @@ fn mk_enum_deser_body(
 ) -> @ast::expr {
     let mut arms = do variants.mapi |v_idx, variant| {
         let body = match variant.node.kind {
-            ast::tuple_variant_kind(args) => {
+            ast::tuple_variant_kind(ref args) => {
                 if args.is_empty() {
                     // for a nullary variant v, do "v"
                     ext_cx.expr_path(span, ~[variant.node.name])
@@ -1051,7 +1057,7 @@ fn mk_enum_deser_body(
                         ext_cx,
                         span,
                         variant.node.name,
-                        args
+                        copy *args
                     )
                 }
             },
@@ -1074,7 +1080,7 @@ fn mk_enum_deser_body(
         }
     };
 
-    let quoted_expr = quote_expr!(
+    let quoted_expr = copy quote_expr!(
       ::core::sys::begin_unwind(~"explicit failure", ~"empty", 1);
     ).node;
 
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index b7641e8b19b..9d597b539bb 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -192,7 +192,7 @@ pub trait ext_ctxt {
 }
 
 pub fn mk_ctxt(parse_sess: @mut parse::ParseSess,
-               cfg: ast::crate_cfg) -> ext_ctxt {
+               +cfg: ast::crate_cfg) -> ext_ctxt {
     struct CtxtRepr {
         parse_sess: @mut parse::ParseSess,
         cfg: ast::crate_cfg,
@@ -203,7 +203,7 @@ pub fn mk_ctxt(parse_sess: @mut parse::ParseSess,
     impl ext_ctxt for CtxtRepr {
         fn codemap(@mut self) -> @CodeMap { self.parse_sess.cm }
         fn parse_sess(@mut self) -> @mut parse::ParseSess { self.parse_sess }
-        fn cfg(@mut self) -> ast::crate_cfg { self.cfg }
+        fn cfg(@mut self) -> ast::crate_cfg { copy self.cfg }
         fn call_site(@mut self) -> span {
             match *self.backtrace {
                 Some(@ExpandedFrom(CallInfo {call_site: cs, _})) => cs,
@@ -214,7 +214,7 @@ pub fn mk_ctxt(parse_sess: @mut parse::ParseSess,
         fn backtrace(@mut self) -> Option<@ExpnInfo> { *self.backtrace }
         fn mod_push(@mut self, i: ast::ident) { self.mod_path.push(i); }
         fn mod_pop(@mut self) { self.mod_path.pop(); }
-        fn mod_path(@mut self) -> ~[ast::ident] { return self.mod_path; }
+        fn mod_path(@mut self) -> ~[ast::ident] { copy self.mod_path }
         fn bt_push(@mut self, ei: codemap::ExpnInfo) {
             match ei {
               ExpandedFrom(CallInfo {call_site: cs, callee: ref callee}) => {
@@ -222,7 +222,7 @@ pub fn mk_ctxt(parse_sess: @mut parse::ParseSess,
                     Some(@ExpandedFrom(CallInfo {
                         call_site: span {lo: cs.lo, hi: cs.hi,
                                          expn_info: *self.backtrace},
-                        callee: (*callee)}));
+                        callee: copy *callee}));
               }
             }
         }
@@ -269,12 +269,11 @@ pub fn mk_ctxt(parse_sess: @mut parse::ParseSess,
         fn set_trace_macros(@mut self, x: bool) {
             self.trace_mac = x
         }
-
         fn str_of(@mut self, id: ast::ident) -> ~str {
-            *self.parse_sess.interner.get(id)
+            copy *self.parse_sess.interner.get(id)
         }
         fn ident_of(@mut self, st: ~str) -> ast::ident {
-            self.parse_sess.interner.intern(@st)
+            self.parse_sess.interner.intern(@/*bad*/ copy st)
         }
     }
     let imp: @mut CtxtRepr = @mut CtxtRepr {
@@ -290,7 +289,7 @@ pub fn mk_ctxt(parse_sess: @mut parse::ParseSess,
 pub fn expr_to_str(cx: ext_ctxt, expr: @ast::expr, err_msg: ~str) -> ~str {
     match expr.node {
       ast::expr_lit(l) => match l.node {
-        ast::lit_str(s) => return *s,
+        ast::lit_str(s) => copy *s,
         _ => cx.span_fatal(l.span, err_msg)
       },
       _ => cx.span_fatal(expr.span, err_msg)
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index 55e5d5fbe17..13a29c54b97 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -26,7 +26,7 @@ pub struct Field {
 
 pub fn mk_expr(cx: ext_ctxt,
                sp: codemap::span,
-               expr: ast::expr_)
+               +expr: ast::expr_)
             -> @ast::expr {
     @ast::expr {
         id: cx.next_id(),
@@ -62,7 +62,7 @@ pub fn mk_unary(cx: ext_ctxt, sp: span, op: ast::unop, e: @ast::expr)
     cx.next_id(); // see ast_util::op_expr_callee_id
     mk_expr(cx, sp, ast::expr_unary(op, e))
 }
-pub fn mk_raw_path(sp: span, idents: ~[ast::ident]) -> @ast::path {
+pub fn mk_raw_path(sp: span, +idents: ~[ast::ident]) -> @ast::path {
     let p = @ast::path { span: sp,
                          global: false,
                          idents: idents,
@@ -71,7 +71,7 @@ pub fn mk_raw_path(sp: span, idents: ~[ast::ident]) -> @ast::path {
     return p;
 }
 pub fn mk_raw_path_(sp: span,
-                    idents: ~[ast::ident],
+                    +idents: ~[ast::ident],
                     +types: ~[@ast::Ty])
                  -> @ast::path {
     @ast::path { span: sp,
@@ -80,17 +80,17 @@ pub fn mk_raw_path_(sp: span,
                  rp: None,
                  types: types }
 }
-pub fn mk_raw_path_global(sp: span, idents: ~[ast::ident]) -> @ast::path {
+pub fn mk_raw_path_global(sp: span, +idents: ~[ast::ident]) -> @ast::path {
     @ast::path { span: sp,
                  global: true,
                  idents: idents,
                  rp: None,
                  types: ~[] }
 }
-pub fn mk_path(cx: ext_ctxt, sp: span, idents: ~[ast::ident]) -> @ast::expr {
+pub fn mk_path(cx: ext_ctxt, sp: span, +idents: ~[ast::ident]) -> @ast::expr {
     mk_expr(cx, sp, ast::expr_path(mk_raw_path(sp, idents)))
 }
-pub fn mk_path_global(cx: ext_ctxt, sp: span, idents: ~[ast::ident])
+pub fn mk_path_global(cx: ext_ctxt, sp: span, +idents: ~[ast::ident])
                    -> @ast::expr {
     mk_expr(cx, sp, ast::expr_path(mk_raw_path_global(sp, idents)))
 }
@@ -98,7 +98,7 @@ pub fn mk_access_(cx: ext_ctxt, sp: span, p: @ast::expr, m: ast::ident)
                -> @ast::expr {
     mk_expr(cx, sp, ast::expr_field(p, m, ~[]))
 }
-pub fn mk_access(cx: ext_ctxt, sp: span, p: ~[ast::ident], m: ast::ident)
+pub fn mk_access(cx: ext_ctxt, sp: span, +p: ~[ast::ident], m: ast::ident)
               -> @ast::expr {
     let pathexpr = mk_path(cx, sp, p);
     return mk_access_(cx, sp, pathexpr, m);
@@ -107,21 +107,21 @@ pub fn mk_addr_of(cx: ext_ctxt, sp: span, e: @ast::expr) -> @ast::expr {
     return mk_expr(cx, sp, ast::expr_addr_of(ast::m_imm, e));
 }
 pub fn mk_call_(cx: ext_ctxt, sp: span, fn_expr: @ast::expr,
-                args: ~[@ast::expr]) -> @ast::expr {
+                +args: ~[@ast::expr]) -> @ast::expr {
     mk_expr(cx, sp, ast::expr_call(fn_expr, args, ast::NoSugar))
 }
-pub fn mk_call(cx: ext_ctxt, sp: span, fn_path: ~[ast::ident],
-               args: ~[@ast::expr]) -> @ast::expr {
+pub fn mk_call(cx: ext_ctxt, sp: span, +fn_path: ~[ast::ident],
+               +args: ~[@ast::expr]) -> @ast::expr {
     let pathexpr = mk_path(cx, sp, fn_path);
     return mk_call_(cx, sp, pathexpr, args);
 }
-pub fn mk_call_global(cx: ext_ctxt, sp: span, fn_path: ~[ast::ident],
-                      args: ~[@ast::expr]) -> @ast::expr {
+pub fn mk_call_global(cx: ext_ctxt, sp: span, +fn_path: ~[ast::ident],
+                      +args: ~[@ast::expr]) -> @ast::expr {
     let pathexpr = mk_path_global(cx, sp, fn_path);
     return mk_call_(cx, sp, pathexpr, args);
 }
 // e = expr, t = type
-pub fn mk_base_vec_e(cx: ext_ctxt, sp: span, exprs: ~[@ast::expr])
+pub fn mk_base_vec_e(cx: ext_ctxt, sp: span, +exprs: ~[@ast::expr])
                   -> @ast::expr {
     let vecexpr = ast::expr_vec(exprs, ast::m_imm);
     mk_expr(cx, sp, vecexpr)
@@ -131,25 +131,25 @@ pub fn mk_vstore_e(cx: ext_ctxt, sp: span, expr: @ast::expr,
    @ast::expr {
     mk_expr(cx, sp, ast::expr_vstore(expr, vst))
 }
-pub fn mk_uniq_vec_e(cx: ext_ctxt, sp: span, exprs: ~[@ast::expr])
+pub fn mk_uniq_vec_e(cx: ext_ctxt, sp: span, +exprs: ~[@ast::expr])
                   -> @ast::expr {
     mk_vstore_e(cx, sp, mk_base_vec_e(cx, sp, exprs), ast::expr_vstore_uniq)
 }
-pub fn mk_slice_vec_e(cx: ext_ctxt, sp: span, exprs: ~[@ast::expr])
+pub fn mk_slice_vec_e(cx: ext_ctxt, sp: span, +exprs: ~[@ast::expr])
                    -> @ast::expr {
     mk_vstore_e(cx, sp, mk_base_vec_e(cx, sp, exprs),
                 ast::expr_vstore_slice)
 }
-pub fn mk_fixed_vec_e(cx: ext_ctxt, sp: span, exprs: ~[@ast::expr])
+pub fn mk_fixed_vec_e(cx: ext_ctxt, sp: span, +exprs: ~[@ast::expr])
                    -> @ast::expr {
     mk_vstore_e(cx, sp, mk_base_vec_e(cx, sp, exprs),
                 ast::expr_vstore_fixed(None))
 }
-pub fn mk_base_str(cx: ext_ctxt, sp: span, s: ~str) -> @ast::expr {
+pub fn mk_base_str(cx: ext_ctxt, sp: span, +s: ~str) -> @ast::expr {
     let lit = ast::lit_str(@s);
     return mk_lit(cx, sp, lit);
 }
-pub fn mk_uniq_str(cx: ext_ctxt, sp: span, s: ~str) -> @ast::expr {
+pub fn mk_uniq_str(cx: ext_ctxt, sp: span, +s: ~str) -> @ast::expr {
     mk_vstore_e(cx, sp, mk_base_str(cx, sp, s), ast::expr_vstore_uniq)
 }
 pub fn mk_field(sp: span, f: &Field) -> ast::field {
@@ -161,28 +161,36 @@ pub fn mk_field(sp: span, f: &Field) -> ast::field {
 pub fn mk_fields(sp: span, fields: ~[Field]) -> ~[ast::field] {
     fields.map(|f| mk_field(sp, f))
 }
-pub fn mk_rec_e(cx: ext_ctxt, sp: span, fields: ~[Field]) -> @ast::expr {
+pub fn mk_rec_e(cx: ext_ctxt,
+                sp: span,
+                +fields: ~[Field])
+             -> @ast::expr {
     mk_expr(cx, sp, ast::expr_rec(mk_fields(sp, fields),
                                   option::None::<@ast::expr>))
 }
-pub fn mk_struct_e(cx: ext_ctxt, sp: span, ctor_path: ~[ast::ident],
-                   fields: ~[Field]) -> @ast::expr {
+pub fn mk_struct_e(cx: ext_ctxt,
+                   sp: span,
+                   +ctor_path: ~[ast::ident],
+                   +fields: ~[Field])
+                -> @ast::expr {
     mk_expr(cx, sp,
             ast::expr_struct(mk_raw_path(sp, ctor_path),
                              mk_fields(sp, fields),
                                     option::None::<@ast::expr>))
 }
-pub fn mk_global_struct_e(cx: ext_ctxt, sp: span,
-                          ctor_path: ~[ast::ident],
-                          fields: ~[Field])
+pub fn mk_global_struct_e(cx: ext_ctxt,
+                          sp: span,
+                          +ctor_path: ~[ast::ident],
+                          +fields: ~[Field])
                        -> @ast::expr {
     mk_expr(cx, sp,
             ast::expr_struct(mk_raw_path_global(sp, ctor_path),
                              mk_fields(sp, fields),
                                     option::None::<@ast::expr>))
 }
-pub fn mk_glob_use(cx: ext_ctxt, sp: span, path: ~[ast::ident])
-            -> @ast::view_item {
+pub fn mk_glob_use(cx: ext_ctxt,
+                   sp: span,
+                   +path: ~[ast::ident]) -> @ast::view_item {
     let glob = @codemap::spanned {
         node: ast::view_path_glob(mk_raw_path(sp, path), cx.next_id()),
         span: sp,
@@ -218,8 +226,8 @@ pub fn mk_local(cx: ext_ctxt, sp: span, mutbl: bool,
     @codemap::spanned { node: ast::stmt_decl(@decl, cx.next_id()), span: sp }
 }
 pub fn mk_block(cx: ext_ctxt, span: span,
-                view_items: ~[@ast::view_item],
-                stmts: ~[@ast::stmt],
+                +view_items: ~[@ast::view_item],
+                +stmts: ~[@ast::stmt],
                 expr: Option<@ast::expr>) -> @ast::expr {
     let blk = codemap::spanned {
         node: ast::blk_ {
@@ -313,7 +321,7 @@ pub fn mk_stmt(cx: ext_ctxt, span: span, expr: @ast::expr) -> @ast::stmt {
 }
 pub fn mk_ty_path(cx: ext_ctxt,
                   span: span,
-                  idents: ~[ ast::ident ])
+                  +idents: ~[ ast::ident ])
                -> @ast::Ty {
     let ty = build::mk_raw_path(span, idents);
     let ty = ast::ty_path(ty, cx.next_id());
@@ -322,7 +330,7 @@ pub fn mk_ty_path(cx: ext_ctxt,
 }
 pub fn mk_ty_path_global(cx: ext_ctxt,
                          span: span,
-                         idents: ~[ ast::ident ])
+                         +idents: ~[ ast::ident ])
                       -> @ast::Ty {
     let ty = build::mk_raw_path_global(span, idents);
     let ty = ast::ty_path(ty, cx.next_id());
diff --git a/src/libsyntax/ext/deriving.rs b/src/libsyntax/ext/deriving.rs
index 4942558f8bc..54fb6bd3bb6 100644
--- a/src/libsyntax/ext/deriving.rs
+++ b/src/libsyntax/ext/deriving.rs
@@ -472,8 +472,8 @@ fn call_substructure_iter_bytes_method(cx: ext_ctxt,
 
 fn variant_arg_count(cx: ext_ctxt, span: span, variant: &variant) -> uint {
     match variant.node.kind {
-        tuple_variant_kind(args) => args.len(),
-        struct_variant_kind(struct_def) => struct_def.fields.len(),
+        tuple_variant_kind(ref args) => args.len(),
+        struct_variant_kind(ref struct_def) => struct_def.fields.len(),
         enum_variant_kind(*) => {
             cx.span_bug(span, ~"variant_arg_count: enum variants deprecated")
         }
diff --git a/src/libsyntax/ext/env.rs b/src/libsyntax/ext/env.rs
index f546c718393..030e819ca3f 100644
--- a/src/libsyntax/ext/env.rs
+++ b/src/libsyntax/ext/env.rs
@@ -31,8 +31,8 @@ pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
     // Option<str> rather than just an maybe-empty string.
 
     let e = match os::getenv(var) {
-      option::None => mk_uniq_str(cx, sp, ~""),
-      option::Some(ref s) => mk_uniq_str(cx, sp, (*s))
+      None => mk_uniq_str(cx, sp, ~""),
+      Some(ref s) => mk_uniq_str(cx, sp, copy *s)
     };
     MRExpr(e)
 }
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index d26b566ecf6..282506929ff 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -52,7 +52,7 @@ pub fn expand_expr(exts: SyntaxExtensions, cx: ext_ctxt,
                             cx.bt_push(ExpandedFrom(CallInfo {
                                 call_site: s,
                                 callee: NameAndSpan {
-                                    name: *extname,
+                                    name: copy *extname,
                                     span: exp_sp,
                                 },
                             }));
@@ -72,7 +72,8 @@ pub fn expand_expr(exts: SyntaxExtensions, cx: ext_ctxt,
                             };
 
                             //keep going, outside-in
-                            let fully_expanded = fld.fold_expr(expanded).node;
+                            let fully_expanded =
+                                copy fld.fold_expr(expanded).node;
                             cx.bt_pop();
 
                             (fully_expanded, s)
@@ -169,7 +170,7 @@ pub fn expand_item_mac(exts: SyntaxExtensions,
 
     let (pth, tts) = match it.node {
         item_mac(codemap::spanned { node: mac_invoc_tt(pth, ref tts), _}) => {
-            (pth, (*tts))
+            (pth, copy *tts)
         }
         _ => cx.span_bug(it.span, ~"invalid item macro invocation")
     };
@@ -189,8 +190,8 @@ pub fn expand_item_mac(exts: SyntaxExtensions,
             cx.bt_push(ExpandedFrom(CallInfo {
                 call_site: it.span,
                 callee: NameAndSpan {
-                    name: *extname,
-                    span: (*expand).span
+                    name: copy *extname,
+                    span: expand.span
                 }
             }));
             ((*expand).expander)(cx, it.span, tts)
@@ -204,8 +205,8 @@ pub fn expand_item_mac(exts: SyntaxExtensions,
             cx.bt_push(ExpandedFrom(CallInfo {
                 call_site: it.span,
                 callee: NameAndSpan {
-                    name: *extname,
-                    span: (*expand).span
+                    name: copy *extname,
+                    span: expand.span
                 }
             }));
             ((*expand).expander)(cx, it.span, it.ident, tts)
@@ -238,7 +239,9 @@ pub fn expand_stmt(exts: SyntaxExtensions, cx: ext_ctxt,
     let (mac, pth, tts, semi) = match *s {
         stmt_mac(ref mac, semi) => {
             match mac.node {
-                mac_invoc_tt(pth, ref tts) => ((*mac), pth, (*tts), semi)
+                mac_invoc_tt(pth, ref tts) => {
+                    (copy *mac, pth, copy *tts, semi)
+                }
             }
         }
         _ => return orig(s, sp, fld)
@@ -254,7 +257,7 @@ pub fn expand_stmt(exts: SyntaxExtensions, cx: ext_ctxt,
             SyntaxExpanderTT{expander: exp, span: exp_sp})) => {
             cx.bt_push(ExpandedFrom(CallInfo {
                 call_site: sp,
-                callee: NameAndSpan { name: *extname, span: exp_sp }
+                callee: NameAndSpan { name: copy *extname, span: exp_sp }
             }));
             let expanded = match exp(cx, mac.span, tts) {
                 MRExpr(e) =>
@@ -267,7 +270,7 @@ pub fn expand_stmt(exts: SyntaxExtensions, cx: ext_ctxt,
             };
 
             //keep going, outside-in
-            let fully_expanded = fld.fold_stmt(expanded).node;
+            let fully_expanded = copy fld.fold_stmt(expanded).node;
             cx.bt_pop();
 
             (fully_expanded, sp)
@@ -351,7 +354,7 @@ pub fn expand_crate(parse_sess: @mut parse::ParseSess,
                     cfg: ast::crate_cfg, c: @crate) -> @crate {
     let exts = syntax_expander_table();
     let afp = default_ast_fold();
-    let cx: ext_ctxt = mk_ctxt(parse_sess, cfg);
+    let cx: ext_ctxt = mk_ctxt(parse_sess, copy cfg);
     let f_pre = @AstFoldFns {
         fold_expr: |a,b,c| expand_expr(exts, cx, a, b, c, afp.fold_expr),
         fold_mod: |a,b| expand_mod_items(exts, cx, a, b, afp.fold_mod),
@@ -362,7 +365,7 @@ pub fn expand_crate(parse_sess: @mut parse::ParseSess,
     let f = make_fold(f_pre);
     let cm = parse_expr_from_source_str(~"<core-macros>",
                                         @core_macros(),
-                                        cfg,
+                                        copy cfg,
                                         parse_sess);
 
     // This is run for its side-effects on the expander env,
diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs
index d15b228365c..2169e8f6f2f 100644
--- a/src/libsyntax/ext/fmt.rs
+++ b/src/libsyntax/ext/fmt.rs
@@ -276,9 +276,9 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span,
     for pieces.each |pc| {
         match *pc {
           PieceString(ref s) => {
-            piece_exprs.push(mk_uniq_str(cx, fmt_sp, (*s)))
+            piece_exprs.push(mk_uniq_str(cx, fmt_sp, copy *s))
           }
-          PieceConv(conv) => {
+          PieceConv(ref conv) => {
             n += 1u;
             if n >= nargs {
                 cx.span_fatal(sp,
@@ -286,9 +286,14 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span,
                                   ~"for the given format string");
             }
             debug!("Building conversion:");
-            log_conv(conv);
+            log_conv(/*bad*/ copy *conv);
             let arg_expr = args[n];
-            let c_expr = make_new_conv(cx, fmt_sp, conv, arg_expr);
+            let c_expr = make_new_conv(
+                cx,
+                fmt_sp,
+                /*bad*/ copy *conv,
+                arg_expr
+            );
             piece_exprs.push(c_expr);
           }
         }
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs
index ed167a8e2a7..7917a072414 100644
--- a/src/libsyntax/ext/pipes/ast_builder.rs
+++ b/src/libsyntax/ext/pipes/ast_builder.rs
@@ -58,14 +58,14 @@ pub impl append_types for @ast::path {
     fn add_ty(&self, ty: @ast::Ty) -> @ast::path {
         @ast::path {
             types: vec::append_one(copy self.types, ty),
-            .. **self
+            .. copy **self
         }
     }
 
     fn add_tys(&self, +tys: ~[@ast::Ty]) -> @ast::path {
         @ast::path {
             types: vec::append(copy self.types, tys),
-            .. **self
+            .. copy **self
         }
     }
 }
@@ -97,12 +97,12 @@ pub trait ext_ctxt_ast_builder {
                  +enum_definition: ast::enum_def) -> @ast::item;
     fn item_struct_poly(&self,
         name: ident, span: span,
-        struct_def: ast::struct_def,
+        +struct_def: ast::struct_def,
         +ty_params: ~[ast::ty_param]) -> @ast::item;
     fn item_struct(&self, name: ident, span: span,
-                   struct_def: ast::struct_def) -> @ast::item;
+                   +struct_def: ast::struct_def) -> @ast::item;
     fn struct_expr(&self, path: @ast::path,
-                   fields: ~[ast::field]) -> @ast::expr;
+                   +fields: ~[ast::field]) -> @ast::expr;
     fn variant(&self, name: ident, span: span,
                +tys: ~[@ast::Ty]) -> ast::variant;
     fn item_mod(&self, name: ident, span: span,
@@ -284,18 +284,18 @@ pub impl ext_ctxt_ast_builder for ext_ctxt {
     }
 
     fn item_struct(&self, name: ident, span: span,
-                   struct_def: ast::struct_def) -> @ast::item {
+                   +struct_def: ast::struct_def) -> @ast::item {
         self.item_struct_poly(name, span, struct_def, ~[])
     }
 
     fn item_struct_poly(&self, name: ident, span: span,
-                        struct_def: ast::struct_def,
+                        +struct_def: ast::struct_def,
                         +ty_params: ~[ast::ty_param]) -> @ast::item {
         self.item(name, span, ast::item_struct(@struct_def, ty_params))
     }
 
     fn struct_expr(&self, path: @ast::path,
-                   fields: ~[ast::field]) -> @ast::expr {
+                   +fields: ~[ast::field]) -> @ast::expr {
         @ast::expr {
             id: self.next_id(),
             callee_id: self.next_id(),
diff --git a/src/libsyntax/ext/pipes/liveness.rs b/src/libsyntax/ext/pipes/liveness.rs
index a7f01d75648..c5bed32a24f 100644
--- a/src/libsyntax/ext/pipes/liveness.rs
+++ b/src/libsyntax/ext/pipes/liveness.rs
@@ -88,7 +88,7 @@ pub fn analyze(proto: protocol, _cx: ext_ctxt) {
     }
 
     if self_live.len() > 0 {
-        let states = str::connect(self_live.map(|s| s.name), ~" ");
+        let states = str::connect(self_live.map(|s| copy s.name), ~" ");
 
         debug!("protocol %s is unbounded due to loops involving: %s",
                proto.name, states);
diff --git a/src/libsyntax/ext/pipes/mod.rs b/src/libsyntax/ext/pipes/mod.rs
index 8b8e48bd522..c26bfd178b0 100644
--- a/src/libsyntax/ext/pipes/mod.rs
+++ b/src/libsyntax/ext/pipes/mod.rs
@@ -65,11 +65,11 @@ pub mod liveness;
 
 
 pub fn expand_proto(cx: ext_ctxt, _sp: span, id: ast::ident,
-                tt: ~[ast::token_tree]) -> base::MacResult {
+                    tt: ~[ast::token_tree]) -> base::MacResult {
     let sess = cx.parse_sess();
     let cfg = cx.cfg();
     let tt_rdr = new_tt_reader(copy cx.parse_sess().span_diagnostic,
-                               cx.parse_sess().interner, None, tt);
+                               cx.parse_sess().interner, None, copy tt);
     let rdr = tt_rdr as reader;
     let rust_parser = Parser(sess, cfg, rdr.dup());
 
diff --git a/src/libsyntax/ext/pipes/parse_proto.rs b/src/libsyntax/ext/pipes/parse_proto.rs
index a5d2a1783d6..ce253f6156b 100644
--- a/src/libsyntax/ext/pipes/parse_proto.rs
+++ b/src/libsyntax/ext/pipes/parse_proto.rs
@@ -18,13 +18,13 @@ use parse::token;
 use core::prelude::*;
 
 pub trait proto_parser {
-    fn parse_proto(&self, id: ~str) -> protocol;
+    fn parse_proto(&self, +id: ~str) -> protocol;
     fn parse_state(&self, proto: protocol);
     fn parse_message(&self, state: state);
 }
 
 pub impl proto_parser for parser::Parser {
-    fn parse_proto(&self, id: ~str) -> protocol {
+    fn parse_proto(&self, +id: ~str) -> protocol {
         let proto = protocol(id, *self.span);
 
         self.parse_seq_to_before_end(
@@ -41,7 +41,7 @@ pub impl proto_parser for parser::Parser {
 
     fn parse_state(&self, proto: protocol) {
         let id = self.parse_ident();
-        let name = *self.interner.get(id);
+        let name = copy *self.interner.get(id);
 
         self.expect(&token::COLON);
         let dir = match copy *self.token {
@@ -76,7 +76,7 @@ pub impl proto_parser for parser::Parser {
     }
 
     fn parse_message(&self, state: state) {
-        let mname = *self.interner.get(self.parse_ident());
+        let mname = copy *self.interner.get(self.parse_ident());
 
         let args = if *self.token == token::LPAREN {
             self.parse_unspanned_seq(
@@ -95,7 +95,7 @@ pub impl proto_parser for parser::Parser {
 
         let next = match *self.token {
           token::IDENT(_, _) => {
-            let name = *self.interner.get(self.parse_ident());
+            let name = copy *self.interner.get(self.parse_ident());
             let ntys = if *self.token == token::LT {
                 self.parse_unspanned_seq(
                     &token::LT,
diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs
index 16de2a20668..be25876cfbf 100644
--- a/src/libsyntax/ext/pipes/pipec.rs
+++ b/src/libsyntax/ext/pipes/pipec.rs
@@ -118,7 +118,7 @@ pub impl gen_send for message {
 
             let mut rty = cx.ty_path_ast_builder(path(~[next.data_name()],
                                                       span)
-                                                 .add_tys(next_state.tys));
+                                               .add_tys(copy next_state.tys));
             if try {
                 rty = cx.ty_option(rty);
             }
@@ -152,7 +152,7 @@ pub impl gen_send for message {
                     ~""
                 }
                 else {
-                    ~"(" + str::connect(arg_names.map(|x| *x),
+                    ~"(" + str::connect(arg_names.map(|x| copy *x),
                                         ~", ") + ~")"
                 };
 
@@ -209,7 +209,7 @@ pub impl to_type_decls for state {
         let mut items_msg = ~[];
 
         for self.messages.each |m| {
-            let message(name, span, tys, this, next) = *m;
+            let message(name, span, tys, this, next) = copy *m;
 
             let tys = match next {
               Some(ref next_state) => {
@@ -225,7 +225,7 @@ pub impl to_type_decls for state {
                                 cx.ty_path_ast_builder(
                                     path(~[cx.ident_of(dir),
                                            cx.ident_of(next_name)], span)
-                                    .add_tys(next_state.tys)))
+                                    .add_tys(copy next_state.tys)))
               }
               None => tys
             };
diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs
index 831b1b79ff8..52eb88d0700 100644
--- a/src/libsyntax/ext/pipes/proto.rs
+++ b/src/libsyntax/ext/pipes/proto.rs
@@ -50,7 +50,7 @@ pub struct message(~str, span, ~[@ast::Ty], state, Option<next_state>);
 pub impl message {
     fn name(&mut self) -> ~str {
         match *self {
-          message(ref id, _, _, _, _) => (*id)
+          message(ref id, _, _, _, _) => copy *id
         }
     }
 
@@ -63,7 +63,7 @@ pub impl message {
     /// Return the type parameters actually used by this message
     fn get_params(&mut self) -> ~[ast::ty_param] {
         match *self {
-          message(_, _, _, this, _) => this.ty_params
+          message(_, _, _, this, _) => copy this.ty_params
         }
     }
 }
@@ -82,8 +82,8 @@ pub struct state_ {
 }
 
 pub impl state_ {
-    fn add_message(@self, name: ~str, span: span,
-                   +data: ~[@ast::Ty], next: Option<next_state>) {
+    fn add_message(@self, +name: ~str, span: span,
+                   +data: ~[@ast::Ty], +next: Option<next_state>) {
         self.messages.push(message(name, span, data, self,
                                    next));
     }
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs
index 6d1ab584446..534953b4c8a 100644
--- a/src/libsyntax/ext/quote.rs
+++ b/src/libsyntax/ext/quote.rs
@@ -262,10 +262,10 @@ pub fn expand_quote_stmt(cx: ext_ctxt,
 }
 
 fn ids_ext(cx: ext_ctxt, strs: ~[~str]) -> ~[ast::ident] {
-    strs.map(|str| cx.parse_sess().interner.intern(@*str))
+    strs.map(|str| cx.parse_sess().interner.intern(@copy *str))
 }
 
-fn id_ext(cx: ext_ctxt, str: ~str) -> ast::ident {
+fn id_ext(cx: ext_ctxt, +str: ~str) -> ast::ident {
     cx.parse_sess().interner.intern(@str)
 }
 
@@ -580,8 +580,8 @@ fn expand_tts(cx: ext_ctxt,
 
 fn expand_parse_call(cx: ext_ctxt,
                      sp: span,
-                     parse_method: ~str,
-                     arg_exprs: ~[@ast::expr],
+                     +parse_method: ~str,
+                     +arg_exprs: ~[@ast::expr],
                      tts: &[ast::token_tree]) -> @ast::expr {
     let tts_expr = expand_tts(cx, sp, tts);
 
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index 82e7de08d65..86c4cbee04b 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -138,10 +138,10 @@ pub fn count_names(ms: &[matcher]) -> uint {
 }
 
 #[allow(non_implicitly_copyable_typarams)]
-pub fn initial_matcher_pos(ms: ~[matcher], sep: Option<Token>, lo: BytePos)
+pub fn initial_matcher_pos(+ms: ~[matcher], sep: Option<Token>, lo: BytePos)
                         -> ~MatcherPos {
     let mut match_idx_hi = 0u;
-    for ms.each() |elt| {
+    for ms.each |elt| {
         match elt.node {
           match_tok(_) => (),
           match_seq(_,_,_,_,hi) => {
@@ -152,12 +152,13 @@ pub fn initial_matcher_pos(ms: ~[matcher], sep: Option<Token>, lo: BytePos)
           }
         }
     }
+    let matches = vec::from_fn(count_names(ms), |_i| dvec::DVec());
     ~MatcherPos {
         elts: ms,
         sep: sep,
         idx: 0u,
         up: matcher_pos_up(None),
-        matches: copy vec::from_fn(count_names(ms), |_i| dvec::DVec()),
+        matches: matches,
         match_lo: 0u,
         match_hi: match_idx_hi,
         sp_lo: lo
@@ -238,7 +239,7 @@ pub fn parse(sess: @mut ParseSess,
              ms: ~[matcher])
           -> parse_result {
     let mut cur_eis = ~[];
-    cur_eis.push(initial_matcher_pos(ms, None, rdr.peek().sp.lo));
+    cur_eis.push(initial_matcher_pos(copy ms, None, rdr.peek().sp.lo));
 
     loop {
         let mut bb_eis = ~[]; // black-box parsed by parser.rs
@@ -329,8 +330,8 @@ pub fn parse(sess: @mut ParseSess,
                                            |_m| DVec::<@named_match>());
                     let ei_t = ei;
                     cur_eis.push(~MatcherPos {
-                        elts: (*matchers),
-                        sep: (*sep),
+                        elts: copy *matchers,
+                        sep: copy *sep,
                         idx: 0u,
                         up: matcher_pos_up(Some(ei_t)),
                         matches: matches,
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index cfb6e45cb5b..5c20abc385d 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -54,7 +54,7 @@ pub fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
 
     // Parse the macro_rules! invocation (`none` is for no interpolations):
     let arg_reader = new_tt_reader(copy cx.parse_sess().span_diagnostic,
-                                   cx.parse_sess().interner, None, arg);
+                                   cx.parse_sess().interner, None, copy arg);
     let argument_map = parse_or_else(cx.parse_sess(), cx.cfg(),
                                      arg_reader as reader, argument_gram);
 
@@ -130,7 +130,7 @@ pub fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
                   }
                   failure(sp, ref msg) => if sp.lo >= best_fail_spot.lo {
                     best_fail_spot = sp;
-                    best_fail_msg = (*msg);
+                    best_fail_msg = copy *msg;
                   },
                   error(sp, ref msg) => cx.span_fatal(sp, (*msg))
                 }
@@ -145,7 +145,7 @@ pub fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
         |cx, sp, arg| generic_extension(cx, sp, name, arg, lhses, rhses);
 
     return MRDef(MacroDef{
-        name: *cx.parse_sess().interner.get(name),
+        name: copy *cx.parse_sess().interner.get(name),
         ext: NormalTT(base::SyntaxExpanderTT{expander: exp, span: Some(sp)})
     });
 }
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs
index a9502ff2902..4aa6236bf5a 100644
--- a/src/libsyntax/ext/tt/transcribe.rs
+++ b/src/libsyntax/ext/tt/transcribe.rs
@@ -54,7 +54,7 @@ pub struct TtReader {
 pub fn new_tt_reader(sp_diag: span_handler,
                      itr: @ident_interner,
                      interp: Option<std::oldmap::HashMap<ident,@named_match>>,
-                     src: ~[ast::token_tree])
+                     +src: ~[ast::token_tree])
                   -> @mut TtReader {
     let r = @mut TtReader {
         sp_diag: sp_diag,
@@ -101,7 +101,7 @@ pub pure fn dup_tt_reader(r: @mut TtReader) -> @mut TtReader {
         interpolations: r.interpolations,
         repeat_idx: copy r.repeat_idx,
         repeat_len: copy r.repeat_len,
-        cur_tok: r.cur_tok,
+        cur_tok: copy r.cur_tok,
         cur_span: r.cur_span
     }
 }
@@ -115,7 +115,7 @@ pure fn lookup_cur_matched_by_matched(r: @mut TtReader,
             // end of the line; duplicate henceforth
             ad
           }
-          matched_seq(ads, _) => ads[*idx]
+          matched_seq(ref ads, _) => ads[*idx]
         }
     }
     vec::foldl(start, r.repeat_idx, red)
@@ -131,15 +131,15 @@ enum lis {
 fn lockstep_iter_size(t: token_tree, r: @mut TtReader) -> lis {
     fn lis_merge(lhs: lis, rhs: lis, r: @mut TtReader) -> lis {
         match lhs {
-          lis_unconstrained => rhs,
-          lis_contradiction(_) => lhs,
+          lis_unconstrained => copy rhs,
+          lis_contradiction(_) => copy lhs,
           lis_constraint(l_len, l_id) => match rhs {
-            lis_unconstrained => lhs,
-            lis_contradiction(_) => rhs,
-            lis_constraint(r_len, _) if l_len == r_len => lhs,
+            lis_unconstrained => copy lhs,
+            lis_contradiction(_) => copy rhs,
+            lis_constraint(r_len, _) if l_len == r_len => copy lhs,
             lis_constraint(r_len, r_id) => {
-                let l_n = *r.interner.get(l_id);
-                let r_n = *r.interner.get(r_id);
+                let l_n = copy *r.interner.get(l_id);
+                let r_n = copy *r.interner.get(r_id);
                 lis_contradiction(fmt!("Inconsistent lockstep iteration: \
                                        '%s' has %u items, but '%s' has %u",
                                         l_n, l_len, r_n, r_len))
@@ -155,14 +155,17 @@ fn lockstep_iter_size(t: token_tree, r: @mut TtReader) -> lis {
       tt_tok(*) => lis_unconstrained,
       tt_nonterminal(_, name) => match *lookup_cur_matched(r, name) {
         matched_nonterminal(_) => lis_unconstrained,
-        matched_seq(ads, _) => lis_constraint(ads.len(), name)
+        matched_seq(ref ads, _) => lis_constraint(ads.len(), name)
       }
     }
 }
 
 
 pub fn tt_next_token(r: @mut TtReader) -> TokenAndSpan {
-    let ret_val = TokenAndSpan { tok: r.cur_tok, sp: r.cur_span };
+    let ret_val = TokenAndSpan {
+        tok: copy r.cur_tok,
+        sp: r.cur_span,
+    };
     while r.cur.idx >= r.cur.readme.len() {
         /* done with this set; pop or repeat? */
         if ! r.cur.dotdotdoted
@@ -210,12 +213,13 @@ pub fn tt_next_token(r: @mut TtReader) -> TokenAndSpan {
             // if this could be 0-length, we'd need to potentially recur here
           }
           tt_tok(sp, copy tok) => {
-            r.cur_span = sp; r.cur_tok = tok;
+            r.cur_span = sp;
+            r.cur_tok = tok;
             r.cur.idx += 1u;
             return ret_val;
           }
           tt_seq(sp, copy tts, copy sep, zerok) => {
-            match lockstep_iter_size(tt_seq(sp, tts, sep, zerok), r) {
+            match lockstep_iter_size(tt_seq(sp, copy tts, sep, zerok), r) {
               lis_unconstrained => {
                 r.sp_diag.span_fatal(
                     sp, /* blame macro writer */
@@ -264,7 +268,8 @@ pub fn tt_next_token(r: @mut TtReader) -> TokenAndSpan {
                 return ret_val;
               }
               matched_nonterminal(ref other_whole_nt) => {
-                r.cur_span = sp; r.cur_tok = INTERPOLATED((*other_whole_nt));
+                r.cur_span = sp;
+                r.cur_tok = INTERPOLATED(copy *other_whole_nt);
                 r.cur.idx += 1u;
                 return ret_val;
               }