mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
move outer_attrs call before the match
This commit is contained in:
parent
0ee6b70b34
commit
116c7aef7f
2 changed files with 9 additions and 16 deletions
|
@ -243,27 +243,20 @@ fn record_pat_field_list(p: &mut Parser) {
|
|||
let m = p.start();
|
||||
p.bump(T!['{']);
|
||||
while !p.at(EOF) && !p.at(T!['}']) {
|
||||
let m = p.start();
|
||||
attributes::outer_attrs(p);
|
||||
|
||||
match p.current() {
|
||||
// A trailing `..` is *not* treated as a REST_PAT.
|
||||
T![.] if p.at(T![..]) => {
|
||||
rest_pat(p);
|
||||
p.bump(T![..]);
|
||||
m.complete(p, REST_PAT);
|
||||
}
|
||||
T!['{'] => error_block(p, "expected ident"),
|
||||
T![#] => {
|
||||
let m = p.start();
|
||||
attributes::outer_attrs(p);
|
||||
if p.at(T![..]) {
|
||||
p.bump(T![..]);
|
||||
m.complete(p, REST_PAT);
|
||||
} else {
|
||||
record_pat_field(p);
|
||||
m.complete(p, RECORD_PAT_FIELD);
|
||||
}
|
||||
T!['{'] => {
|
||||
error_block(p, "expected ident");
|
||||
m.abandon(p);
|
||||
}
|
||||
|
||||
_ => {
|
||||
let m = p.start();
|
||||
attributes::outer_attrs(p);
|
||||
record_pat_field(p);
|
||||
m.complete(p, RECORD_PAT_FIELD);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ rayon = "1"
|
|||
expect-test = "1.1"
|
||||
proc-macro2 = "1.0.8"
|
||||
quote = "1.0.2"
|
||||
ungrammar = "=1.14.5"
|
||||
ungrammar = "=1.14.6"
|
||||
|
||||
test_utils = { path = "../test_utils" }
|
||||
sourcegen = { path = "../sourcegen" }
|
||||
|
|
Loading…
Reference in a new issue