From 7a294e998b66ea6d410a6840cba80347fc4764c2 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 6 Mar 2024 11:02:56 +1100 Subject: Rename `IntoDiagnostic` as `Diagnostic`. To match `derive(Diagnostic)`. Also rename `into_diagnostic` as `into_diag`. --- compiler/rustc_macros/src/diagnostics/diagnostic.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'compiler/rustc_macros/src') diff --git a/compiler/rustc_macros/src/diagnostics/diagnostic.rs b/compiler/rustc_macros/src/diagnostics/diagnostic.rs index a1a7b19642b..c28e096455f 100644 --- a/compiler/rustc_macros/src/diagnostics/diagnostic.rs +++ b/compiler/rustc_macros/src/diagnostics/diagnostic.rs @@ -10,7 +10,7 @@ use quote::quote; use syn::spanned::Spanned; use synstructure::Structure; -/// The central struct for constructing the `into_diagnostic` method from an annotated struct. +/// The central struct for constructing the `into_diag` method from an annotated struct. pub(crate) struct DiagnosticDerive<'a> { structure: Structure<'a>, } @@ -72,14 +72,11 @@ impl<'a> DiagnosticDerive<'a> { // A lifetime of `'a` causes conflicts, but `_sess` is fine. let mut imp = structure.gen_impl(quote! { - gen impl<'_sess, G> - rustc_errors::IntoDiagnostic<'_sess, G> - for @Self + gen impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for @Self where G: rustc_errors::EmissionGuarantee { - #[track_caller] - fn into_diagnostic( + fn into_diag( self, dcx: &'_sess rustc_errors::DiagCtxt, level: rustc_errors::Level -- cgit 1.4.1-3-g733a5