diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-10-01 00:58:30 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-10-01 01:10:12 +0300 |
| commit | 6ea4a52f47f3f66f9db9004d8ed55a819dd81523 (patch) | |
| tree | 2c31b5b563ee076e13ab2b223899a4db7aa11374 /src/libsyntax | |
| parent | 957986d05620238799ae7053d505f742a0c7d640 (diff) | |
Address review comments
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/parse/attr.rs | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index e2c8e37e11c..023952042e6 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -2156,6 +2156,7 @@ pub struct Attribute { pub span: Span, } +// Compatibility impl to avoid churn, consider removing. impl std::ops::Deref for Attribute { type Target = AttrItem; fn deref(&self) -> &Self::Target { &self.item } diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index f3298b6a65d..e74f3045db8 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -166,7 +166,7 @@ impl<'a> Parser<'a> { /// PATH `[` TOKEN_STREAM `]` /// PATH `{` TOKEN_STREAM `}` /// PATH - /// PATH `=` TOKEN_TREE + /// PATH `=` UNSUFFIXED_LIT /// The delimiters or `=` are still put into the resulting token stream. pub fn parse_attr_item(&mut self) -> PResult<'a, ast::AttrItem> { let item = match self.token.kind { @@ -262,7 +262,7 @@ impl<'a> Parser<'a> { /// Matches the following grammar (per RFC 1559). /// - /// meta_item : IDENT ( '=' UNSUFFIXED_LIT | '(' meta_item_inner? ')' )? ; + /// meta_item : PATH ( '=' UNSUFFIXED_LIT | '(' meta_item_inner? ')' )? ; /// meta_item_inner : (meta_item | UNSUFFIXED_LIT) (',' meta_item_inner)? ; pub fn parse_meta_item(&mut self) -> PResult<'a, ast::MetaItem> { let nt_meta = match self.token.kind { |
