diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-07-02 12:47:32 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-07-17 14:57:51 -0700 |
| commit | 99b33f721954bc5290f9201c8f64003c294d0571 (patch) | |
| tree | 786c9bf75d54512d0a80f6975ad40516ab432c3a /src/libsyntax/ext/tt/macro_rules.rs | |
| parent | b4e674f6e662bc80f2e7a5a1a9834f2152f08d32 (diff) | |
| download | rust-99b33f721954bc5290f9201c8f64003c294d0571.tar.gz rust-99b33f721954bc5290f9201c8f64003c294d0571.zip | |
librustc: Remove all uses of "copy".
Diffstat (limited to 'src/libsyntax/ext/tt/macro_rules.rs')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 6b3ce1c9a2f..399a1827c68 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -32,7 +32,10 @@ pub fn add_new_extension(cx: @ExtCtxt, -> base::MacResult { // these spans won't matter, anyways fn ms(m: matcher_) -> matcher { - spanned { node: copy m, span: dummy_sp() } + spanned { + node: m.clone(), + span: dummy_sp() + } } let lhs_nm = gensym_ident("lhs"); @@ -55,7 +58,7 @@ pub fn add_new_extension(cx: @ExtCtxt, // Parse the macro_rules! invocation (`none` is for no interpolations): let arg_reader = new_tt_reader(cx.parse_sess().span_diagnostic, None, - copy arg); + arg.clone()); let argument_map = parse_or_else(cx.parse_sess(), cx.cfg(), arg_reader as @reader, @@ -63,12 +66,12 @@ pub fn add_new_extension(cx: @ExtCtxt, // Extract the arguments: let lhses = match *argument_map.get(&lhs_nm) { - @matched_seq(ref s, _) => /* FIXME (#2543) */ @copy *s, + @matched_seq(ref s, _) => /* FIXME (#2543) */ @(*s).clone(), _ => cx.span_bug(sp, "wrong-structured lhs") }; let rhses = match *argument_map.get(&rhs_nm) { - @matched_seq(ref s, _) => /* FIXME (#2543) */ @copy *s, + @matched_seq(ref s, _) => /* FIXME (#2543) */ @(*s).clone(), _ => cx.span_bug(sp, "wrong-structured rhs") }; @@ -132,7 +135,7 @@ pub fn add_new_extension(cx: @ExtCtxt, } failure(sp, ref msg) => if sp.lo >= best_fail_spot.lo { best_fail_spot = sp; - best_fail_msg = copy *msg; + best_fail_msg = (*msg).clone(); }, error(sp, ref msg) => cx.span_fatal(sp, (*msg)) } |
