diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index d52e497cf63..d184c671bba 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -1439,8 +1439,8 @@ impl KeywordIdents { { let next_edition = match cx.sess.edition() { Edition::Edition2015 => { - match &ident.as_str()[..] { - "async" | "await" | "try" => Edition::Edition2018, + match ident.name { + kw::Async | kw::Await | kw::Try => Edition::Edition2018, // rust-lang/rust#56327: Conservatively do not // attempt to report occurrences of `dyn` within @@ -1454,7 +1454,7 @@ impl KeywordIdents { // its precise role in the parsed AST and thus are // assured this is truly an attempt to use it as // an identifier. - "dyn" if !under_macro => Edition::Edition2018, + kw::Dyn if !under_macro => Edition::Edition2018, _ => return, }