Rollup merge of #130489 - compiler-errors:raw-lt-lint, r=jieyouxu

Ensure that `keyword_ident` lint doesn't trigger on `'r#kw` lifetime

Fixes #130486
This commit is contained in:
Matthias Krüger 2024-09-18 04:42:31 +02:00 committed by GitHub
commit 32c4d4112c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -299,6 +299,9 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
lifetime_name += lifetime_name_without_tick;
let sym = Symbol::intern(&lifetime_name);
// Make sure we mark this as a raw identifier.
self.psess.raw_identifier_spans.push(self.mk_sp(start, self.pos));
token::Lifetime(sym, IdentIsRaw::Yes)
} else {
// Otherwise, this should be parsed like `'r`. Warn about it though.

View File

@ -0,0 +1,8 @@
//@ edition: 2021
//@ check-pass
#![deny(keyword_idents_2024)]
fn foo<'r#gen>() {}
fn main() {}