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.
This commit is contained in:
commit
65205652b8
1 changed files with 4 additions and 4 deletions
|
|
@ -1741,10 +1741,10 @@ import public items from their destination, not private items.
|
|||
## Attributes
|
||||
|
||||
~~~~ {.notrust .ebnf .gram}
|
||||
attribute : '#' '!' ? '[' attr_list ']' ;
|
||||
attr_list : attr [ ',' attr_list ]* ;
|
||||
attr : ident [ '=' literal
|
||||
| '(' attr_list ')' ] ? ;
|
||||
attribute : '#' '!' ? '[' meta_item ']' ;
|
||||
meta_item : ident [ '=' literal
|
||||
| '(' meta_seq ')' ] ? ;
|
||||
meta_seq : meta_item [ ',' meta_seq ]* ;
|
||||
~~~~
|
||||
|
||||
Static entities in Rust — crates, modules and items — may have _attributes_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue