string is not a keyword

This commit is contained in:
Lukas Wirth 2024-07-17 11:11:30 +02:00
parent 7011094685
commit b8cac1bb6b
5 changed files with 13 additions and 5 deletions

View file

@ -178,6 +178,12 @@ impl<'a> Converter<'a> {
rustc_lexer::TokenKind::Whitespace => WHITESPACE,
rustc_lexer::TokenKind::Ident if token_text == "_" => UNDERSCORE,
rustc_lexer::TokenKind::Ident
if ["async", "await", "dyn", "try"].contains(&token_text)
&& !self.edition.at_least_2018() =>
{
IDENT
}
rustc_lexer::TokenKind::Ident
if token_text == "gen" && !self.edition.at_least_2024() =>
{