1
Fork 0

rollup merge of #20554: huonw/mut-pattern

Conflicts:
	src/librustc_typeck/check/_match.rs
This commit is contained in:
Alex Crichton 2015-01-05 18:38:51 -08:00
commit bb5e16b4b8
19 changed files with 92 additions and 26 deletions

View file

@ -3351,11 +3351,16 @@ impl<'a> Parser<'a> {
})
}
token::BinOp(token::And) | token::AndAnd => {
// parse &pat
// parse &pat and &mut pat
let lo = self.span.lo;
self.expect_and();
let mutability = if self.eat_keyword(keywords::Mut) {
ast::MutMutable
} else {
ast::MutImmutable
};
let sub = self.parse_pat();
pat = PatRegion(sub);
pat = PatRegion(sub, mutability);
hi = self.last_span.hi;
return P(ast::Pat {
id: ast::DUMMY_NODE_ID,