rollup merge of #20554: huonw/mut-pattern
Conflicts: src/librustc_typeck/check/_match.rs
This commit is contained in:
commit
bb5e16b4b8
19 changed files with 92 additions and 26 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue