diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-05-29 19:59:33 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-05-30 15:20:36 -0400 |
| commit | 7a1a40890d48321c69f66bd07e3a23d5d5ab939a (patch) | |
| tree | 54eb8701f89acc95b05a2de5cfcd5c9be2742a3d /src/libsyntax/ext | |
| parent | 5209709e46ecfac2fd4db527952fe7ef96400801 (diff) | |
| download | rust-7a1a40890d48321c69f66bd07e3a23d5d5ab939a.tar.gz rust-7a1a40890d48321c69f66bd07e3a23d5d5ab939a.zip | |
Remove copy bindings from patterns.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/build.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/iter_bytes.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/rand.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/source_util.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/transcribe.rs | 12 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 2a3c266cfa6..85bebebf0f6 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -560,7 +560,7 @@ impl AstBuilder for @ExtCtxt { self.pat(span, ast::pat_lit(expr)) } fn pat_ident(&self, span: span, ident: ast::ident) -> @ast::pat { - self.pat_ident_binding_mode(span, ident, ast::bind_by_copy) + self.pat_ident_binding_mode(span, ident, ast::bind_infer) } fn pat_ident_binding_mode(&self, diff --git a/src/libsyntax/ext/deriving/iter_bytes.rs b/src/libsyntax/ext/deriving/iter_bytes.rs index 64ce6dfbc19..10fb4b8ecd4 100644 --- a/src/libsyntax/ext/deriving/iter_bytes.rs +++ b/src/libsyntax/ext/deriving/iter_bytes.rs @@ -62,11 +62,11 @@ fn iter_bytes_substructure(cx: @ExtCtxt, span: span, substr: &Substructure) -> @ Struct(ref fs) => { fields = fs } - EnumMatching(copy index, ref variant, ref fs) => { + EnumMatching(index, ref variant, ref fs) => { // Determine the discriminant. We will feed this value to the byte // iteration function. let discriminant = match variant.node.disr_expr { - Some(copy d)=> d, + Some(d)=> d, None => cx.expr_uint(span, index) }; diff --git a/src/libsyntax/ext/deriving/rand.rs b/src/libsyntax/ext/deriving/rand.rs index b2e039786ad..54d31de7c50 100644 --- a/src/libsyntax/ext/deriving/rand.rs +++ b/src/libsyntax/ext/deriving/rand.rs @@ -119,7 +119,7 @@ fn rand_substructure(cx: @ExtCtxt, span: span, substr: &Substructure) -> @expr { summary: &Either<uint, ~[ident]>, rand_call: &fn() -> @expr) -> @expr { match *summary { - Left(copy count) => { + Left(count) => { if count == 0 { cx.expr_ident(span, ctor_ident) } else { diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index 8a60b239b89..91fad0c22a6 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -58,8 +58,8 @@ pub fn expand_file(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree]) base::check_zero_tts(cx, sp, tts, "file!"); let topmost = topmost_expn_info(cx.backtrace().get()); - let Loc { file: @FileMap { name: filename, _ }, _ } = - cx.codemap().lookup_char_pos(topmost.call_site.lo); + let loc = cx.codemap().lookup_char_pos(topmost.call_site.lo); + let filename = copy loc.file.name; base::MRExpr(cx.expr_str(topmost.call_site, filename)) } diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 183bc2a77c5..ec63b5a7f74 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -423,7 +423,7 @@ pub fn parse_nt(p: &Parser, name: &str) -> nonterminal { }, "block" => token::nt_block(p.parse_block()), "stmt" => token::nt_stmt(p.parse_stmt(~[])), - "pat" => token::nt_pat(p.parse_pat(true)), + "pat" => token::nt_pat(p.parse_pat()), "expr" => token::nt_expr(p.parse_expr()), "ty" => token::nt_ty(p.parse_ty(false /* no need to disambiguate*/)), // this could be handled like a token, since it is one diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index cac963727e3..4a6a070df50 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -207,8 +207,8 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan { } else { /* repeat */ r.stack.idx = 0u; r.repeat_idx[r.repeat_idx.len() - 1u] += 1u; - match r.stack.sep { - Some(copy tk) => { + match copy r.stack.sep { + Some(tk) => { r.cur_tok = tk; /* repeat same span, I guess */ return ret_val; } @@ -218,8 +218,8 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan { } loop { /* because it's easiest, this handles `tt_delim` not starting with a `tt_tok`, even though it won't happen */ - match r.stack.forest[r.stack.idx] { - tt_delim(copy tts) => { + match copy r.stack.forest[r.stack.idx] { + tt_delim(tts) => { r.stack = @mut TtFrame { forest: @mut tts, idx: 0u, @@ -229,13 +229,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) => { + tt_tok(sp, tok) => { r.cur_span = sp; r.cur_tok = tok; r.stack.idx += 1u; return ret_val; } - tt_seq(sp, copy tts, copy sep, zerok) => { + tt_seq(sp, tts, sep, zerok) => { let t = tt_seq(sp, copy tts, copy sep, zerok); match lockstep_iter_size(&t, r) { lis_unconstrained => { |
