Skip to content

Commit a7eaa1f

Browse files
committed
syntax: Allow closure args to be mutable
1 parent 800b8a7 commit a7eaa1f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ impl Parser {
747747
fn parse_fn_block_arg() -> arg_or_capture_item {
748748
do self.parse_capture_item_or |p| {
749749
let m = p.parse_arg_mode();
750+
let is_mutbl = self.eat_keyword(~"mut");
750751
let pat = p.parse_pat(false);
751752
let t = if p.eat(token::COLON) {
752753
p.parse_ty(false)
@@ -759,7 +760,7 @@ impl Parser {
759760
};
760761
either::Left(ast::arg {
761762
mode: m,
762-
is_mutbl: false,
763+
is_mutbl: is_mutbl,
763764
ty: t,
764765
pat: pat,
765766
id: p.get_id()

0 commit comments

Comments
 (0)