libsyntax: Forbid ~mut and ~const. rs=demuting

This commit is contained in:
Patrick Walton 2013-02-26 11:32:00 -08:00
parent 061a223723
commit 8d7e6ef772
9 changed files with 33 additions and 46 deletions

View file

@ -678,7 +678,7 @@ pub impl Parser {
// reflected in the AST type.
let mt = self.parse_mt();
if mt.mutbl == m_mutbl && sigil == OwnedSigil {
if mt.mutbl != m_imm && sigil == OwnedSigil {
self.obsolete(*self.last_span, ObsoleteMutOwnedPointer);
}
@ -1574,6 +1574,10 @@ pub impl Parser {
token::TILDE => {
self.bump();
let m = self.parse_mutability();
if m != m_imm {
self.obsolete(*self.last_span, ObsoleteMutOwnedPointer);
}
let e = self.parse_prefix_expr();
hi = e.span.hi;
// HACK: turn ~[...] into a ~-evec