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() {
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,
}