From 3f7a086b4f8f4c83ba03b36dcb722b897b260e6b Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 21 Apr 2021 11:08:15 +0200 Subject: Parse outer atttributes for RecordPatField --- crates/parser/src/grammar/patterns.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/parser/src/grammar') diff --git a/crates/parser/src/grammar/patterns.rs b/crates/parser/src/grammar/patterns.rs index da71498a8..3ab347834 100644 --- a/crates/parser/src/grammar/patterns.rs +++ b/crates/parser/src/grammar/patterns.rs @@ -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); -- cgit v1.2.3