mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Allow attribute on struct literal field
This commit is contained in:
parent
7d3f48cdaf
commit
a1d84f5fb0
3 changed files with 54 additions and 1 deletions
|
@ -453,8 +453,13 @@ pub(crate) fn named_field_list(p: &mut Parser) {
|
|||
p.bump();
|
||||
while !p.at(EOF) && !p.at(R_CURLY) {
|
||||
match p.current() {
|
||||
IDENT => {
|
||||
// test struct_literal_field_with_attr
|
||||
// fn main() {
|
||||
// S { #[cfg(test)] field: 1 }
|
||||
// }
|
||||
IDENT | POUND => {
|
||||
let m = p.start();
|
||||
attributes::outer_attributes(p);
|
||||
name_ref(p);
|
||||
if p.eat(COLON) {
|
||||
expr(p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue