File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -2156,6 +2156,7 @@ pub struct Attribute {
21562156 pub span : Span ,
21572157}
21582158
2159+ // Compatibility impl to avoid churn, consider removing.
21592160impl std:: ops:: Deref for Attribute {
21602161 type Target = AttrItem ;
21612162 fn deref ( & self ) -> & Self :: Target { & self . item }
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ impl<'a> Parser<'a> {
166166 /// PATH `[` TOKEN_STREAM `]`
167167 /// PATH `{` TOKEN_STREAM `}`
168168 /// PATH
169- /// PATH `=` TOKEN_TREE
169+ /// PATH `=` UNSUFFIXED_LIT
170170 /// The delimiters or `=` are still put into the resulting token stream.
171171 pub fn parse_attr_item ( & mut self ) -> PResult < ' a , ast:: AttrItem > {
172172 let item = match self . token . kind {
@@ -262,7 +262,7 @@ impl<'a> Parser<'a> {
262262
263263 /// Matches the following grammar (per RFC 1559).
264264 ///
265- /// meta_item : IDENT ( '=' UNSUFFIXED_LIT | '(' meta_item_inner? ')' )? ;
265+ /// meta_item : PATH ( '=' UNSUFFIXED_LIT | '(' meta_item_inner? ')' )? ;
266266 /// meta_item_inner : (meta_item | UNSUFFIXED_LIT) (',' meta_item_inner)? ;
267267 pub fn parse_meta_item ( & mut self ) -> PResult < ' a , ast:: MetaItem > {
268268 let nt_meta = match self . token . kind {
Original file line number Diff line number Diff line change 1+ // check-pass
2+
3+ macro_rules! check { ( $meta: meta) => ( ) }
4+
5+ check ! ( meta( a b c d) ) ;
6+ check ! ( meta[ a b c d] ) ;
7+ check ! ( meta { a b c d } ) ;
8+ check ! ( meta) ;
9+ check ! ( meta = 0 ) ;
10+
11+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments