1
Fork 0

Use Symbol equality in check_ident_token.

This commit is contained in:
Nicholas Nethercote 2019-05-23 16:11:52 +10:00
parent 8ae01a9008
commit 15789a9773

View file

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