Skip to content

Commit b661e49

Browse files
committed
Remove is_any_keyword methods.
They're dodgy, covering all the keywords, including weak ones, and edition-specific ones without considering the edition. They have a single use in rustfmt. This commit changes that use to `is_reserved_ident`, which is a much more widely used alternative and is good enough, judging by the lack of effect on the test suite.
1 parent ad0b41c commit b661e49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parse/macros/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub(crate) struct ParsedMacroArgs {
8181
}
8282

8383
fn check_keyword<'a, 'b: 'a>(parser: &'a mut Parser<'b>) -> Option<MacroArg> {
84-
if parser.token.is_any_keyword()
84+
if parser.token.is_reserved_ident()
8585
&& parser.look_ahead(1, |t| *t == TokenKind::Eof || *t == TokenKind::Comma)
8686
{
8787
let keyword = parser.token.ident().unwrap().0.name;

0 commit comments

Comments
 (0)