libsyntax/librustc: Allow specifying mut on ~self.

This commit is contained in:
Luqman Aden 2013-10-20 02:34:01 -04:00
parent 5754848f8c
commit af163579ed
11 changed files with 23 additions and 11 deletions

View file

@ -3520,7 +3520,7 @@ impl Parser {
self.span_err(*self.last_span,
"mutability declaration not allowed here");
}
sty_uniq
sty_uniq(MutImmutable)
}, self)
}
token::IDENT(*) if self.is_self_ident() => {
@ -3546,6 +3546,14 @@ impl Parser {
self.expect_self_ident();
sty_value(mutability)
}
_ if self.token_is_mutability(self.token) &&
self.look_ahead(1, |t| *t == token::TILDE) &&
self.look_ahead(2, |t| token::is_keyword(keywords::Self, t)) => {
let mutability = self.parse_mutability();
self.bump();
self.expect_self_ident();
sty_uniq(mutability)
}
_ => {
sty_static
}