diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-05-05 18:56:44 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-05-06 23:12:54 -0700 |
| commit | 090040bf4037a094e50b03d79e4baf5cd89c912b (patch) | |
| tree | 27fa91d623889d59260d3db167abdfa8c4288849 /src/libsyntax/ext/tt | |
| parent | 24f6f26e633e50b5b59f9d0f6cca0b1e49e215d9 (diff) | |
| download | rust-090040bf4037a094e50b03d79e4baf5cd89c912b.tar.gz rust-090040bf4037a094e50b03d79e4baf5cd89c912b.zip | |
librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
Diffstat (limited to 'src/libsyntax/ext/tt')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/transcribe.rs | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 4c426bef12e..ee3ff0c389e 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -102,7 +102,7 @@ pub struct MatcherPos { elts: Vec<ast::Matcher> , // maybe should be <'>? Need to understand regions. sep: Option<Token>, idx: uint, - up: Option<~MatcherPos>, + up: Option<Box<MatcherPos>>, matches: Vec<Vec<Rc<NamedMatch>>>, match_lo: uint, match_hi: uint, sp_lo: BytePos, @@ -120,7 +120,7 @@ pub fn count_names(ms: &[Matcher]) -> uint { } pub fn initial_matcher_pos(ms: Vec<Matcher> , sep: Option<Token>, lo: BytePos) - -> ~MatcherPos { + -> Box<MatcherPos> { let mut match_idx_hi = 0u; for elt in ms.iter() { match elt.node { diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index ab0266cedaa..5a02acdae1c 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -95,7 +95,7 @@ impl MacroExpander for MacroRulesMacroExpander { cx: &mut ExtCtxt, sp: Span, arg: &[ast::TokenTree]) - -> ~MacResult { + -> Box<MacResult> { generic_extension(cx, sp, self.name, @@ -121,7 +121,7 @@ fn generic_extension(cx: &ExtCtxt, arg: &[ast::TokenTree], lhses: &[Rc<NamedMatch>], rhses: &[Rc<NamedMatch>]) - -> ~MacResult { + -> Box<MacResult> { if cx.trace_macros() { println!("{}! \\{ {} \\}", token::get_ident(name), @@ -171,7 +171,7 @@ fn generic_extension(cx: &ExtCtxt, // Weird, but useful for X-macros. return box ParserAnyMacro { parser: RefCell::new(p), - } as ~MacResult + } as Box<MacResult> } Failure(sp, ref msg) => if sp.lo >= best_fail_spot.lo { best_fail_spot = sp; @@ -193,7 +193,7 @@ pub fn add_new_extension(cx: &mut ExtCtxt, sp: Span, name: Ident, arg: Vec<ast::TokenTree> ) - -> ~base::MacResult { + -> Box<base::MacResult> { // these spans won't matter, anyways fn ms(m: Matcher_) -> Matcher { Spanned { @@ -250,5 +250,5 @@ pub fn add_new_extension(cx: &mut ExtCtxt, name: token::get_ident(name).to_str(), ext: NormalTT(exp, Some(sp)) })) - } as ~MacResult + } as Box<MacResult> } diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 8fa4857cab0..f6bee033553 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -254,7 +254,7 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan { /* sidestep the interpolation tricks for ident because (a) idents can be in lots of places, so it'd be a pain (b) we actually can, since it's a token. */ - MatchedNonterminal(NtIdent(~sn,b)) => { + MatchedNonterminal(NtIdent(box sn, b)) => { r.cur_span = sp; r.cur_tok = IDENT(sn,b); return ret_val; |
