1
Fork 0

librustc: Remove mutable fields from the language.

They're still parsed though, to get through bootstrapping.
This commit is contained in:
Patrick Walton 2013-05-03 18:51:58 -07:00
parent c7522417d4
commit db4573a776
19 changed files with 69 additions and 177 deletions

View file

@ -45,7 +45,7 @@ use ast::{pat_tup, pat_uniq, pat_wild, private};
use ast::{rem, required};
use ast::{ret_style, return_val, self_ty, shl, shr, stmt, stmt_decl};
use ast::{stmt_expr, stmt_semi, stmt_mac, struct_def, struct_field};
use ast::{struct_immutable, struct_mutable, struct_variant_kind, subtract};
use ast::{struct_variant_kind, subtract};
use ast::{sty_box, sty_region, sty_static, sty_uniq, sty_value};
use ast::{token_tree, trait_method, trait_ref, tt_delim, tt_seq, tt_tok};
use ast::{tt_nonterminal, tuple_variant_kind, Ty, ty_, ty_bot, ty_box};
@ -2528,10 +2528,10 @@ pub impl Parser {
fn parse_name_and_ty(&self,
pr: visibility,
attrs: ~[attribute]) -> @struct_field {
let mut is_mutbl = struct_immutable;
let lo = self.span.lo;
if self.eat_keyword(&~"mut") {
is_mutbl = struct_mutable;
// Do nothing, for backwards compatibility.
// XXX: Remove after snapshot.
}
if !is_plain_ident(&*self.token) {
self.fatal(~"expected ident");
@ -2540,7 +2540,7 @@ pub impl Parser {
self.expect(&token::COLON);
let ty = self.parse_ty(false);
@spanned(lo, self.last_span.hi, ast::struct_field_ {
kind: named_field(name, is_mutbl, pr),
kind: named_field(name, pr),
id: self.get_id(),
ty: ty,
attrs: attrs,