diff options
| author | bors <bors@rust-lang.org> | 2013-05-08 17:09:37 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-08 17:09:37 -0700 |
| commit | d82d9874a6f88e0afa021796e9efaba5b3670c31 (patch) | |
| tree | 4270207820c8eca6e33cf2bbf9f1bbcafe9d74a9 /src/libsyntax/parse/parser.rs | |
| parent | 5a65f51d666855d7685850808cc06e49c3d21c72 (diff) | |
| parent | d20e63ab65f7ba28db36ae43379706ca9dba1ca5 (diff) | |
| download | rust-d82d9874a6f88e0afa021796e9efaba5b3670c31.tar.gz rust-d82d9874a6f88e0afa021796e9efaba5b3670c31.zip | |
auto merge of #6232 : pcwalton/rust/demuting, r=pcwalton
They're still parsed for bootstrapping purposes, but the qualifier is immediately dropped on the floor. r? @nikomatsakis
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 810efd39177..0543295eb4e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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}; @@ -390,8 +390,8 @@ pub impl Parser { // parse a ty_closure type fn parse_ty_closure(&self, sigil: ast::Sigil, - region: Option<@ast::Lifetime>) -> ty_ - { + region: Option<@ast::Lifetime>) + -> ty_ { /* (&|~|@) ['r] [pure|unsafe] [once] fn <'lt> (S) -> T @@ -773,20 +773,17 @@ pub impl Parser { return ty_rptr(opt_lifetime, mt); } - // parse an optional mode. - // XXX: Remove after snapshot. + // parse an optional, obsolete argument mode. fn parse_arg_mode(&self) { if self.eat(&token::BINOP(token::MINUS)) { self.obsolete(*self.span, ObsoleteMode); } else if self.eat(&token::ANDAND) { - // Ignore. + self.obsolete(*self.span, ObsoleteMode); } else if self.eat(&token::BINOP(token::PLUS)) { if self.eat(&token::BINOP(token::PLUS)) { - // ++ mode is obsolete, but we need a snapshot - // to stop parsing it. - // Ignore. + self.obsolete(*self.span, ObsoleteMode); } else { - // Ignore. + self.obsolete(*self.span, ObsoleteMode); } } else { // Ignore. @@ -2528,10 +2525,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 +2537,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, |
