address review comments

This commit is contained in:
Deadbeef
2025-08-22 13:06:49 +08:00
parent 30bb7045d6
commit 4970127c33
15 changed files with 30 additions and 35 deletions

View File

@@ -1479,8 +1479,7 @@ impl<'a> Parser<'a> {
pub(super) fn expect_lifetime(&mut self) -> Lifetime {
if let Some((ident, is_raw)) = self.token.lifetime() {
if matches!(is_raw, IdentIsRaw::No)
&& ident.without_first_quote().is_reserved()
&& ![kw::UnderscoreLifetime, kw::StaticLifetime].contains(&ident.name)
&& ident.without_first_quote().is_reserved_lifetime()
{
self.dcx().emit_err(errors::KeywordLifetime { span: ident.span });
}