diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-06-23 21:12:17 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-06-29 08:36:25 -0700 |
| commit | 3bad7129ebb13d7a4c0a7965aeb5bd536cc0f5f0 (patch) | |
| tree | 7c3ae5ff601a9cae33459eccaddc7d12cc76f6e2 /src/libsyntax/parse | |
| parent | b29c36867418ea551b23c767f45454eea4623d79 (diff) | |
| download | rust-3bad7129ebb13d7a4c0a7965aeb5bd536cc0f5f0.tar.gz rust-3bad7129ebb13d7a4c0a7965aeb5bd536cc0f5f0.zip | |
Remove mutability from unique boxes in the AST
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f1b5c4d16be..cc0baa28e20 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2071,9 +2071,8 @@ impl Parser { ex = match e.node { expr_vec(*) | expr_lit(@codemap::spanned { node: lit_str(_), span: _}) | - expr_repeat(*) - if m == m_imm => expr_vstore(e, expr_vstore_uniq), - _ => self.mk_unary(uniq(m), e) + expr_repeat(*) => expr_vstore(e, expr_vstore_uniq), + _ => self.mk_unary(uniq, e) }; } _ => return self.parse_dot_or_call_expr() @@ -3366,7 +3365,12 @@ impl Parser { maybe_parse_explicit_self(sty_box, self) } token::TILDE => { - maybe_parse_explicit_self(sty_uniq, self) + maybe_parse_explicit_self(|mutability| { + if mutability != m_imm { + self.obsolete(*self.last_span, ObsoleteMutOwnedPointer); + } + sty_uniq + }, self) } token::IDENT(*) if self.is_self_ident() => { self.bump(); |
