Handle Struct { box i }
syntax
Named structs can have `box` patterns that will bind to their fields. This is similar to the behavior of the `ref` and `mut` fields, but is at least a little bit surprising.
This commit is contained in:
parent
83433cd1f0
commit
c08ad1cf8a
@ -161,6 +161,9 @@ fn record_field_pat_list(p: &mut Parser) {
|
||||
T![..] => p.bump(),
|
||||
IDENT if p.nth(1) == T![:] => record_field_pat(p),
|
||||
T!['{'] => error_block(p, "expected ident"),
|
||||
T![box] => {
|
||||
box_pat(p);
|
||||
}
|
||||
_ => {
|
||||
bind_pat(p, false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user