Skip to content

Commit 0ad82b8

Browse files
committed
libsyntax: De-@mut Parser::restriction
1 parent 9380397 commit 0ad82b8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ pub fn Parser(sess: @mut ParseSess, cfg: ast::CrateConfig, rdr: @mut reader)
314314
buffer_start: 0,
315315
buffer_end: 0,
316316
tokens_consumed: 0,
317-
restriction: @mut UNRESTRICTED,
317+
restriction: UNRESTRICTED,
318318
quote_depth: 0,
319319
obsolete_set: @mut HashSet::new(),
320320
mod_path_stack: @mut ~[],
@@ -339,7 +339,7 @@ pub struct Parser {
339339
buffer_start: int,
340340
buffer_end: int,
341341
tokens_consumed: uint,
342-
restriction: @mut restriction,
342+
restriction: restriction,
343343
quote_depth: uint, // not (yet) related to the quasiquoter
344344
reader: @mut reader,
345345
interner: @token::ident_interner,
@@ -2356,7 +2356,7 @@ impl Parser {
23562356
// scope of the borrows.
23572357
{
23582358
let token: &token::Token = &self.token;
2359-
let restriction: &restriction = self.restriction;
2359+
let restriction: &restriction = &self.restriction;
23602360
match (token, restriction) {
23612361
(&token::BINOP(token::OR), &RESTRICT_NO_BAR_OP) => return lhs,
23622362
(&token::BINOP(token::OR),
@@ -2700,10 +2700,10 @@ impl Parser {
27002700

27012701
// parse an expression, subject to the given restriction
27022702
fn parse_expr_res(&mut self, r: restriction) -> @Expr {
2703-
let old = *self.restriction;
2704-
*self.restriction = r;
2703+
let old = self.restriction;
2704+
self.restriction = r;
27052705
let e = self.parse_assign_expr();
2706-
*self.restriction = old;
2706+
self.restriction = old;
27072707
return e;
27082708
}
27092709

@@ -3310,7 +3310,7 @@ impl Parser {
33103310

33113311
// is this expression a successfully-parsed statement?
33123312
fn expr_is_complete(&mut self, e: @Expr) -> bool {
3313-
return *self.restriction == RESTRICT_STMT_EXPR &&
3313+
return self.restriction == RESTRICT_STMT_EXPR &&
33143314
!classify::expr_requires_semi_to_be_stmt(e);
33153315
}
33163316

0 commit comments

Comments
 (0)