From 3bad7129ebb13d7a4c0a7965aeb5bd536cc0f5f0 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sun, 23 Jun 2013 21:12:17 -0700 Subject: Remove mutability from unique boxes in the AST --- src/libsyntax/parse/parser.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/libsyntax/parse') 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(); -- cgit 1.4.1-3-g733a5