Rollup merge of #144897 - fee1-dead-contrib:raw_lifetimes_printing, r=fmease

print raw lifetime idents with r#

This replaces rust-lang/rust#143185 and fixes rust-lang/rust#143150

cc ``@fmease``
This commit is contained in:
Jacob Pratt
2025-08-22 22:00:47 -04:00
committed by GitHub
21 changed files with 192 additions and 73 deletions

View File

@@ -3094,7 +3094,7 @@ impl<'a> Parser<'a> {
if let Some((ident, is_raw)) = self.token.lifetime() {
// Disallow `'fn`, but with a better error message than `expect_lifetime`.
if matches!(is_raw, IdentIsRaw::No) && ident.without_first_quote().is_reserved() {
self.dcx().emit_err(errors::InvalidLabel { span: ident.span, name: ident.name });
self.dcx().emit_err(errors::KeywordLabel { span: ident.span });
}
self.bump();