libsyntax: Stop parsing mutable fields

This commit is contained in:
Patrick Walton 2013-05-23 19:47:38 -07:00
parent 481d4ca43f
commit 4e3d4b36dc
6 changed files with 6 additions and 15 deletions

View file

@ -1157,11 +1157,13 @@ pub impl Parser {
// parse ident COLON expr
fn parse_field(&self) -> field {
let lo = self.span.lo;
let m = self.parse_mutability();
let i = self.parse_ident();
self.expect(&token::COLON);
let e = self.parse_expr();
spanned(lo, e.span.hi, ast::field_ { mutbl: m, ident: i, expr: e })
spanned(lo, e.span.hi, ast::field_ {
ident: i,
expr: e
})
}
fn mk_expr(&self, lo: BytePos, hi: BytePos, node: expr_) -> @expr {
@ -2566,10 +2568,6 @@ pub impl Parser {
pr: visibility,
attrs: ~[attribute]) -> @struct_field {
let lo = self.span.lo;
if self.eat_keyword(keywords::Mut) {
// Do nothing, for backwards compatibility.
// XXX: Remove after snapshot.
}
if !is_plain_ident(&*self.token) {
self.fatal("expected ident");
}