Skip to content

Commit 15789a9

Browse files
committed
Use Symbol equality in check_ident_token.
1 parent 8ae01a9 commit 15789a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_lint/builtin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1439,8 +1439,8 @@ impl KeywordIdents {
14391439
{
14401440
let next_edition = match cx.sess.edition() {
14411441
Edition::Edition2015 => {
1442-
match &ident.as_str()[..] {
1443-
"async" | "await" | "try" => Edition::Edition2018,
1442+
match ident.name {
1443+
kw::Async | kw::Await | kw::Try => Edition::Edition2018,
14441444

14451445
// rust-lang/rust#56327: Conservatively do not
14461446
// attempt to report occurrences of `dyn` within
@@ -1454,7 +1454,7 @@ impl KeywordIdents {
14541454
// its precise role in the parsed AST and thus are
14551455
// assured this is truly an attempt to use it as
14561456
// an identifier.
1457-
"dyn" if !under_macro => Edition::Edition2018,
1457+
kw::Dyn if !under_macro => Edition::Edition2018,
14581458

14591459
_ => return,
14601460
}

0 commit comments

Comments
 (0)