auto merge of #13908 : pcwalton/rust/box-pattern, r=alexcrichton
r? @alexcrichton
This commit is contained in:
commit
9c1761d0ab
2 changed files with 33 additions and 0 deletions
|
@ -2867,6 +2867,19 @@ impl<'a> Parser<'a> {
|
|||
// parse ref pat
|
||||
let mutbl = self.parse_mutability();
|
||||
pat = self.parse_pat_ident(BindByRef(mutbl));
|
||||
} else if self.eat_keyword(keywords::Box) {
|
||||
// `box PAT`
|
||||
//
|
||||
// FIXME(#13910): Rename to `PatBox` and extend to full DST
|
||||
// support.
|
||||
let sub = self.parse_pat();
|
||||
pat = PatUniq(sub);
|
||||
hi = self.last_span.hi;
|
||||
return @ast::Pat {
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
node: pat,
|
||||
span: mk_sp(lo, hi)
|
||||
}
|
||||
} else {
|
||||
let can_be_enum_or_struct = self.look_ahead(1, |t| {
|
||||
match *t {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue