Skip to content

Commit 6520565

Browse files
committed
auto merge of #14043 : sanxiyn/rust/attr-reference, r=alexcrichton
Attribute grammar in reference manual allowed `#[foo, bar]`, which does not match parser behavior. Also rename nonterminals to match parser code. Fix #13825.
2 parents 5200215 + a4b7b8d commit 6520565

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/doc/rust.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,10 +1741,10 @@ import public items from their destination, not private items.
17411741
## Attributes
17421742

17431743
~~~~ {.notrust .ebnf .gram}
1744-
attribute : '#' '!' ? '[' attr_list ']' ;
1745-
attr_list : attr [ ',' attr_list ]* ;
1746-
attr : ident [ '=' literal
1747-
| '(' attr_list ')' ] ? ;
1744+
attribute : '#' '!' ? '[' meta_item ']' ;
1745+
meta_item : ident [ '=' literal
1746+
| '(' meta_seq ')' ] ? ;
1747+
meta_seq : meta_item [ ',' meta_seq ]* ;
17481748
~~~~
17491749

17501750
Static entities in Rust — crates, modules and items — may have _attributes_

0 commit comments

Comments
 (0)