mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
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
1 changed files with 3 additions and 0 deletions
|
@ -161,6 +161,9 @@ fn record_field_pat_list(p: &mut Parser) {
|
||||||
T![..] => p.bump(),
|
T![..] => p.bump(),
|
||||||
IDENT if p.nth(1) == T![:] => record_field_pat(p),
|
IDENT if p.nth(1) == T![:] => record_field_pat(p),
|
||||||
T!['{'] => error_block(p, "expected ident"),
|
T!['{'] => error_block(p, "expected ident"),
|
||||||
|
T![box] => {
|
||||||
|
box_pat(p);
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
bind_pat(p, false);
|
bind_pat(p, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue