Auto merge of #132761 - nnethercote:resolve-tweaks, r=petrochenkov

Resolve tweaks

A couple of small perf improvements, and some minor refactorings, all in `rustc_resolve`.

r? `@petrochenkov`
This commit is contained in:
bors 2024-11-19 19:54:35 +00:00
commit ee612c45f0
5 changed files with 54 additions and 94 deletions

View file

@ -641,9 +641,10 @@ impl<'a> Parser<'a> {
return true;
}
// Do an ASCII case-insensitive match, because all keywords are ASCII.
if case == Case::Insensitive
&& let Some((ident, IdentIsRaw::No)) = self.token.ident()
&& ident.as_str().to_lowercase() == kw.as_str().to_lowercase()
&& ident.as_str().eq_ignore_ascii_case(kw.as_str())
{
true
} else {