From 4dc7fab56f224467439237dafb8b3211f1a0d165 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 18 Dec 2023 09:48:51 +1100 Subject: [PATCH] Rename `__diagnostic_handler_sess` as `_sess`. --- compiler/rustc_macros/src/diagnostics/diagnostic.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_macros/src/diagnostics/diagnostic.rs b/compiler/rustc_macros/src/diagnostics/diagnostic.rs index ebae1d7b8ad..5de0203fc1d 100644 --- a/compiler/rustc_macros/src/diagnostics/diagnostic.rs +++ b/compiler/rustc_macros/src/diagnostics/diagnostic.rs @@ -79,9 +79,10 @@ impl<'a> DiagnosticDerive<'a> { let DiagnosticDeriveKind::Diagnostic { dcx } = &builder.kind else { unreachable!() }; + // A lifetime of `'a` causes conflicts, but `_sess` is fine. let mut imp = structure.gen_impl(quote! { - gen impl<'__diagnostic_handler_sess, G> - rustc_errors::IntoDiagnostic<'__diagnostic_handler_sess, G> + gen impl<'_sess, G> + rustc_errors::IntoDiagnostic<'_sess, G> for @Self where G: rustc_errors::EmissionGuarantee { @@ -89,8 +90,8 @@ impl<'a> DiagnosticDerive<'a> { #[track_caller] fn into_diagnostic( self, - #dcx: &'__diagnostic_handler_sess rustc_errors::DiagCtxt - ) -> rustc_errors::DiagnosticBuilder<'__diagnostic_handler_sess, G> { + #dcx: &'_sess rustc_errors::DiagCtxt + ) -> rustc_errors::DiagnosticBuilder<'_sess, G> { use rustc_errors::IntoDiagnosticArg; #implementation }