From 4ee95cf96c8e4d30b8d0dfa83f58d050cae10fae Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 30 Dec 2013 15:34:28 -0800 Subject: libsyntax: De-`@mut` `Parser::restriction` --- src/libsyntax/parse/parser.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libsyntax/parse/parser.rs') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index c7f0996dfc6..749000d00d2 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -314,7 +314,7 @@ pub fn Parser(sess: @mut ParseSess, cfg: ast::CrateConfig, rdr: @mut reader) buffer_start: 0, buffer_end: 0, tokens_consumed: 0, - restriction: @mut UNRESTRICTED, + restriction: UNRESTRICTED, quote_depth: 0, obsolete_set: @mut HashSet::new(), mod_path_stack: @mut ~[], @@ -339,7 +339,7 @@ pub struct Parser { buffer_start: int, buffer_end: int, tokens_consumed: uint, - restriction: @mut restriction, + restriction: restriction, quote_depth: uint, // not (yet) related to the quasiquoter reader: @mut reader, interner: @token::ident_interner, @@ -2356,7 +2356,7 @@ impl Parser { // scope of the borrows. { let token: &token::Token = &self.token; - let restriction: &restriction = self.restriction; + let restriction: &restriction = &self.restriction; match (token, restriction) { (&token::BINOP(token::OR), &RESTRICT_NO_BAR_OP) => return lhs, (&token::BINOP(token::OR), @@ -2700,10 +2700,10 @@ impl Parser { // parse an expression, subject to the given restriction fn parse_expr_res(&mut self, r: restriction) -> @Expr { - let old = *self.restriction; - *self.restriction = r; + let old = self.restriction; + self.restriction = r; let e = self.parse_assign_expr(); - *self.restriction = old; + self.restriction = old; return e; } @@ -3310,7 +3310,7 @@ impl Parser { // is this expression a successfully-parsed statement? fn expr_is_complete(&mut self, e: @Expr) -> bool { - return *self.restriction == RESTRICT_STMT_EXPR && + return self.restriction == RESTRICT_STMT_EXPR && !classify::expr_requires_semi_to_be_stmt(e); } -- cgit 1.4.1-3-g733a5