We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c303c44 commit 883e90dCopy full SHA for 883e90d
src/librustc_parse/parser/attr.rs
@@ -201,12 +201,8 @@ impl<'a> Parser<'a> {
201
let mut attrs: Vec<ast::Attribute> = vec![];
202
loop {
203
match self.token.kind {
204
- token::Pound => {
205
- // Don't even try to parse if it's not an inner attribute.
206
- if !self.look_ahead(1, |t| t == &token::Not) {
207
- break;
208
- }
209
-
+ // Only try to parse if it is an inner attribute (has `!`).
+ token::Pound if self.look_ahead(1, |t| t == &token::Not) => {
210
let attr = self.parse_attribute(true)?;
211
assert_eq!(attr.style, ast::AttrStyle::Inner);
212
attrs.push(attr);
0 commit comments