Parse outer atttributes for RecordPatField

This commit is contained in:
Lukas Wirth 2021-04-21 11:08:15 +02:00
parent 70fe7a4515
commit 3f7a086b4f
3 changed files with 57 additions and 8 deletions

View file

@ -206,13 +206,15 @@ fn record_pat_field_list(p: &mut Parser) {
T![.] if p.at(T![..]) => p.bump(T![..]),
T!['{'] => error_block(p, "expected ident"),
c => {
_ => {
let m = p.start();
match c {
attributes::outer_attrs(p);
match p.current() {
// test record_pat_field
// fn foo() {
// let S { 0: 1 } = ();
// let S { x: 1 } = ();
// let S { #[cfg(any())] x: 1 } = ();
// }
IDENT | INT_NUMBER if p.nth(1) == T![:] => {
name_ref_or_index(p);