mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
Store raw ident span for raw lifetime
This commit is contained in:
parent
f609b7e058
commit
5de89bb011
@ -299,6 +299,9 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
|
|||||||
lifetime_name += lifetime_name_without_tick;
|
lifetime_name += lifetime_name_without_tick;
|
||||||
let sym = Symbol::intern(&lifetime_name);
|
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)
|
token::Lifetime(sym, IdentIsRaw::Yes)
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, this should be parsed like `'r`. Warn about it though.
|
// Otherwise, this should be parsed like `'r`. Warn about it though.
|
||||||
|
8
tests/ui/rust-2024/raw-gen-lt.rs
Normal file
8
tests/ui/rust-2024/raw-gen-lt.rs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
//@ edition: 2021
|
||||||
|
//@ check-pass
|
||||||
|
|
||||||
|
#![deny(keyword_idents_2024)]
|
||||||
|
|
||||||
|
fn foo<'r#gen>() {}
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
Reference in New Issue
Block a user