diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-05-23 16:11:52 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-05-27 14:05:05 +1000 |
| commit | 15789a97737c1cada44aa253fbbcee80ecd40895 (patch) | |
| tree | 807073c9f7cce5077fb166daa706cb8010fdecea | |
| parent | 8ae01a90088fd62987030ff382733ed67791d4f8 (diff) | |
Use `Symbol` equality in `check_ident_token`.
| -rw-r--r-- | src/librustc_lint/builtin.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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, } |
