diff --git a/compiler/rustc_attr/src/session_diagnostics.rs b/compiler/rustc_attr/src/session_diagnostics.rs index ed8400391c28d..a4f51871f67af 100644 --- a/compiler/rustc_attr/src/session_diagnostics.rs +++ b/compiler/rustc_attr/src/session_diagnostics.rs @@ -1,7 +1,7 @@ use std::num::IntErrorKind; use rustc_ast as ast; -use rustc_errors::SessionDiagnostic; +use rustc_errors::DiagnosticHandler; use rustc_errors::{ error_code, fluent, Applicability, DiagnosticBuilder, ErrorGuaranteed, Handler, }; @@ -50,7 +50,7 @@ pub(crate) struct UnknownMetaItem<'a> { } // Manual implementation to be able to format `expected` items correctly. -impl<'a> SessionDiagnostic<'a> for UnknownMetaItem<'_> { +impl<'a> DiagnosticHandler<'a> for UnknownMetaItem<'_> { fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> { let expected = self.expected.iter().map(|name| format!("`{}`", name)).collect::>(); let mut diag = handler.struct_span_err_with_code( @@ -209,7 +209,7 @@ pub(crate) struct UnsupportedLiteral { pub start_point_span: Span, } -impl<'a> SessionDiagnostic<'a> for UnsupportedLiteral { +impl<'a> DiagnosticHandler<'a> for UnsupportedLiteral { fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> { let mut diag = handler.struct_span_err_with_code( self.span, diff --git a/compiler/rustc_error_messages/locales/en-US/lint.ftl b/compiler/rustc_error_messages/locales/en-US/lint.ftl index 7f9918e4f128f..726c9619a4f5e 100644 --- a/compiler/rustc_error_messages/locales/en-US/lint.ftl +++ b/compiler/rustc_error_messages/locales/en-US/lint.ftl @@ -51,7 +51,7 @@ lint_non_existant_doc_keyword = found non-existing keyword `{$keyword}` used in .help = only existing keywords are allowed in core/std lint_diag_out_of_impl = - diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls + diagnostics should only be created in `DiagnosticHandler`/`AddSubdiagnostic` impls lint_untranslatable_diag = diagnostics should be created using translatable messages diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs index 71e21373d0da1..1eaca60c0898c 100644 --- a/compiler/rustc_errors/src/diagnostic_builder.rs +++ b/compiler/rustc_errors/src/diagnostic_builder.rs @@ -16,7 +16,7 @@ use std::thread::panicking; /// Trait implemented by error types. This should not be implemented manually. Instead, use /// `#[derive(SessionDiagnostic)]` -- see [rustc_macros::SessionDiagnostic]. #[rustc_diagnostic_item = "SessionDiagnostic"] -pub trait SessionDiagnostic<'a, T: EmissionGuarantee = ErrorGuaranteed> { +pub trait DiagnosticHandler<'a, T: EmissionGuarantee = ErrorGuaranteed> { /// Write out as a diagnostic out of `Handler`. #[must_use] fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, T>; diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index b2a3cb0823d18..e99a0e96f305a 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -61,7 +61,7 @@ mod snippet; mod styled_buffer; pub mod translation; -pub use diagnostic_builder::SessionDiagnostic; +pub use diagnostic_builder::DiagnosticHandler; pub use snippet::Style; pub type PResult<'a, T> = Result>; diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs index a9c690a4fb9c5..5141122cb864a 100644 --- a/compiler/rustc_expand/src/base.rs +++ b/compiler/rustc_expand/src/base.rs @@ -11,7 +11,7 @@ use rustc_attr::{self as attr, Deprecation, Stability}; use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_data_structures::sync::{self, Lrc}; use rustc_errors::{ - Applicability, DiagnosticBuilder, ErrorGuaranteed, MultiSpan, PResult, SessionDiagnostic, + Applicability, DiagnosticBuilder, DiagnosticHandler, ErrorGuaranteed, MultiSpan, PResult, }; use rustc_lint_defs::builtin::PROC_MACRO_BACK_COMPAT; use rustc_lint_defs::{BufferedEarlyLint, BuiltinLintDiagnostics}; @@ -1104,12 +1104,12 @@ impl<'a> ExtCtxt<'a> { pub fn create_err( &self, - err: impl SessionDiagnostic<'a>, + err: impl DiagnosticHandler<'a>, ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { self.sess.create_err(err) } - pub fn emit_err(&self, err: impl SessionDiagnostic<'a>) -> ErrorGuaranteed { + pub fn emit_err(&self, err: impl DiagnosticHandler<'a>) -> ErrorGuaranteed { self.sess.emit_err(err) } diff --git a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs index 0b814305ff2ed..1b70a9760c44f 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs @@ -4,7 +4,7 @@ use crate::errors::{ }; use crate::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; use crate::infer::InferCtxt; -use rustc_errors::SessionDiagnostic; +use rustc_errors::DiagnosticHandler; use rustc_errors::{DiagnosticBuilder, ErrorGuaranteed, IntoDiagnosticArg}; use rustc_hir as hir; use rustc_hir::def::Res; diff --git a/compiler/rustc_lint/src/errors.rs b/compiler/rustc_lint/src/errors.rs index ac98948189ba1..9e88defbc2701 100644 --- a/compiler/rustc_lint/src/errors.rs +++ b/compiler/rustc_lint/src/errors.rs @@ -1,4 +1,4 @@ -use rustc_errors::{fluent, AddSubdiagnostic, ErrorGuaranteed, Handler, SessionDiagnostic}; +use rustc_errors::{fluent, AddSubdiagnostic, DiagnosticHandler, ErrorGuaranteed, Handler}; use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic}; use rustc_session::lint::Level; use rustc_span::{Span, Symbol}; @@ -119,7 +119,7 @@ pub struct CheckNameUnknown { pub sub: RequestedLevel, } -impl SessionDiagnostic<'_> for CheckNameUnknown { +impl DiagnosticHandler<'_> for CheckNameUnknown { fn into_diagnostic( self, handler: &Handler, diff --git a/compiler/rustc_macros/src/diagnostics/diagnostic.rs b/compiler/rustc_macros/src/diagnostics/diagnostic.rs index 891b6a118ded5..dc31d942ba28c 100644 --- a/compiler/rustc_macros/src/diagnostics/diagnostic.rs +++ b/compiler/rustc_macros/src/diagnostics/diagnostic.rs @@ -81,15 +81,15 @@ impl<'a> SessionDiagnosticDerive<'a> { }; structure.gen_impl(quote! { - gen impl<'__session_diagnostic_sess, G> - rustc_errors::SessionDiagnostic<'__session_diagnostic_sess, G> + gen impl<'__diagnostic_handler_sess, G> + rustc_errors::DiagnosticHandler<'__diagnostic_handler_sess, G> for @Self where G: rustc_errors::EmissionGuarantee { fn into_diagnostic( self, - #sess: &'__session_diagnostic_sess rustc_errors::Handler - ) -> rustc_errors::DiagnosticBuilder<'__session_diagnostic_sess, G> { + #sess: &'__diagnostic_handler_sess rustc_errors::Handler + ) -> rustc_errors::DiagnosticBuilder<'__diagnostic_handler_sess, G> { use rustc_errors::IntoDiagnosticArg; #implementation } diff --git a/compiler/rustc_metadata/src/errors.rs b/compiler/rustc_metadata/src/errors.rs index 40357ec0701ad..4b853cd643a90 100644 --- a/compiler/rustc_metadata/src/errors.rs +++ b/compiler/rustc_metadata/src/errors.rs @@ -3,7 +3,7 @@ use std::{ path::{Path, PathBuf}, }; -use rustc_errors::{error_code, ErrorGuaranteed, SessionDiagnostic}; +use rustc_errors::{error_code, DiagnosticHandler, ErrorGuaranteed}; use rustc_macros::SessionDiagnostic; use rustc_session::config; use rustc_span::{sym, Span, Symbol}; @@ -421,7 +421,7 @@ pub(crate) struct MultipleCandidates { pub candidates: Vec, } -impl SessionDiagnostic<'_> for MultipleCandidates { +impl DiagnosticHandler<'_> for MultipleCandidates { fn into_diagnostic( self, handler: &'_ rustc_errors::Handler, @@ -537,7 +537,7 @@ pub struct InvalidMetadataFiles { pub crate_rejections: Vec, } -impl SessionDiagnostic<'_> for InvalidMetadataFiles { +impl DiagnosticHandler<'_> for InvalidMetadataFiles { fn into_diagnostic( self, handler: &'_ rustc_errors::Handler, @@ -565,7 +565,7 @@ pub struct CannotFindCrate { pub locator_triple: TargetTriple, } -impl SessionDiagnostic<'_> for CannotFindCrate { +impl DiagnosticHandler<'_> for CannotFindCrate { fn into_diagnostic( self, handler: &'_ rustc_errors::Handler, diff --git a/compiler/rustc_monomorphize/src/errors.rs b/compiler/rustc_monomorphize/src/errors.rs index 883380dca08a2..43337287a94e7 100644 --- a/compiler/rustc_monomorphize/src/errors.rs +++ b/compiler/rustc_monomorphize/src/errors.rs @@ -1,7 +1,7 @@ use std::path::PathBuf; +use rustc_errors::DiagnosticHandler; use rustc_errors::ErrorGuaranteed; -use rustc_errors::SessionDiagnostic; use rustc_macros::{LintDiagnostic, SessionDiagnostic}; use rustc_span::Span; @@ -44,7 +44,7 @@ pub struct UnusedGenericParams { pub param_names: Vec, } -impl SessionDiagnostic<'_> for UnusedGenericParams { +impl DiagnosticHandler<'_> for UnusedGenericParams { fn into_diagnostic( self, handler: &'_ rustc_errors::Handler, diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 7a7fbe3b34665..ee50775a72708 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -35,7 +35,7 @@ use rustc_ast::{AnonConst, BinOp, BinOpKind, FnDecl, FnRetTy, MacCall, Param, Ty use rustc_ast::{Arm, Async, BlockCheckMode, Expr, ExprKind, Label, Movability, RangeLimits}; use rustc_ast::{ClosureBinder, StmtKind}; use rustc_ast_pretty::pprust; -use rustc_errors::SessionDiagnostic; +use rustc_errors::DiagnosticHandler; use rustc_errors::{Applicability, Diagnostic, PResult}; use rustc_session::lint::builtin::BREAK_WITH_LABEL_AND_LOOP; use rustc_session::lint::BuiltinLintDiagnostics; diff --git a/compiler/rustc_query_system/src/query/job.rs b/compiler/rustc_query_system/src/query/job.rs index cfeb8695f2d81..c5d4c41b2be2d 100644 --- a/compiler/rustc_query_system/src/query/job.rs +++ b/compiler/rustc_query_system/src/query/job.rs @@ -4,7 +4,7 @@ use crate::query::{QueryContext, QueryStackFrame}; use rustc_data_structures::fx::FxHashMap; use rustc_errors::{ - Diagnostic, DiagnosticBuilder, ErrorGuaranteed, Handler, Level, SessionDiagnostic, + Diagnostic, DiagnosticBuilder, DiagnosticHandler, ErrorGuaranteed, Handler, Level, }; use rustc_hir::def::DefKind; use rustc_session::Session; diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 433c1cdbc5402..03a8e85700434 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -11,8 +11,8 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet}; use rustc_data_structures::sync::{Lock, Lrc}; use rustc_errors::{emitter::SilentEmitter, ColorConfig, Handler}; use rustc_errors::{ - fallback_fluent_bundle, Applicability, Diagnostic, DiagnosticBuilder, DiagnosticId, - DiagnosticMessage, EmissionGuarantee, ErrorGuaranteed, MultiSpan, SessionDiagnostic, StashKey, + fallback_fluent_bundle, Applicability, Diagnostic, DiagnosticBuilder, DiagnosticHandler, + DiagnosticId, DiagnosticMessage, EmissionGuarantee, ErrorGuaranteed, MultiSpan, StashKey, }; use rustc_feature::{find_feature_issue, GateIssue, UnstableFeatures}; use rustc_span::edition::Edition; @@ -340,34 +340,34 @@ impl ParseSess { pub fn create_err<'a>( &'a self, - err: impl SessionDiagnostic<'a>, + err: impl DiagnosticHandler<'a>, ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { err.into_diagnostic(&self.span_diagnostic) } - pub fn emit_err<'a>(&'a self, err: impl SessionDiagnostic<'a>) -> ErrorGuaranteed { + pub fn emit_err<'a>(&'a self, err: impl DiagnosticHandler<'a>) -> ErrorGuaranteed { self.create_err(err).emit() } pub fn create_warning<'a>( &'a self, - warning: impl SessionDiagnostic<'a, ()>, + warning: impl DiagnosticHandler<'a, ()>, ) -> DiagnosticBuilder<'a, ()> { warning.into_diagnostic(&self.span_diagnostic) } - pub fn emit_warning<'a>(&'a self, warning: impl SessionDiagnostic<'a, ()>) { + pub fn emit_warning<'a>(&'a self, warning: impl DiagnosticHandler<'a, ()>) { self.create_warning(warning).emit() } pub fn create_fatal<'a>( &'a self, - fatal: impl SessionDiagnostic<'a, !>, + fatal: impl DiagnosticHandler<'a, !>, ) -> DiagnosticBuilder<'a, !> { fatal.into_diagnostic(&self.span_diagnostic) } - pub fn emit_fatal<'a>(&'a self, fatal: impl SessionDiagnostic<'a, !>) -> ! { + pub fn emit_fatal<'a>(&'a self, fatal: impl DiagnosticHandler<'a, !>) -> ! { self.create_fatal(fatal).emit() } diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index c5fc70f6de71e..4334604577161 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -20,8 +20,8 @@ use rustc_errors::emitter::{Emitter, EmitterWriter, HumanReadableErrorType}; use rustc_errors::json::JsonEmitter; use rustc_errors::registry::Registry; use rustc_errors::{ - error_code, fallback_fluent_bundle, DiagnosticBuilder, DiagnosticId, DiagnosticMessage, - ErrorGuaranteed, FluentBundle, LazyFallbackBundle, MultiSpan, SessionDiagnostic, + error_code, fallback_fluent_bundle, DiagnosticBuilder, DiagnosticHandler, DiagnosticId, + DiagnosticMessage, ErrorGuaranteed, FluentBundle, LazyFallbackBundle, MultiSpan, }; use rustc_macros::HashStable_Generic; pub use rustc_span::def_id::StableCrateId; @@ -454,13 +454,13 @@ impl Session { } pub fn create_err<'a>( &'a self, - err: impl SessionDiagnostic<'a>, + err: impl DiagnosticHandler<'a>, ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { self.parse_sess.create_err(err) } pub fn create_feature_err<'a>( &'a self, - err: impl SessionDiagnostic<'a>, + err: impl DiagnosticHandler<'a>, feature: Symbol, ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { let mut err = self.parse_sess.create_err(err); @@ -470,25 +470,25 @@ impl Session { add_feature_diagnostics(&mut err, &self.parse_sess, feature); err } - pub fn emit_err<'a>(&'a self, err: impl SessionDiagnostic<'a>) -> ErrorGuaranteed { + pub fn emit_err<'a>(&'a self, err: impl DiagnosticHandler<'a>) -> ErrorGuaranteed { self.parse_sess.emit_err(err) } pub fn create_warning<'a>( &'a self, - err: impl SessionDiagnostic<'a, ()>, + err: impl DiagnosticHandler<'a, ()>, ) -> DiagnosticBuilder<'a, ()> { self.parse_sess.create_warning(err) } - pub fn emit_warning<'a>(&'a self, warning: impl SessionDiagnostic<'a, ()>) { + pub fn emit_warning<'a>(&'a self, warning: impl DiagnosticHandler<'a, ()>) { self.parse_sess.emit_warning(warning) } pub fn create_fatal<'a>( &'a self, - fatal: impl SessionDiagnostic<'a, !>, + fatal: impl DiagnosticHandler<'a, !>, ) -> DiagnosticBuilder<'a, !> { self.parse_sess.create_fatal(fatal) } - pub fn emit_fatal<'a>(&'a self, fatal: impl SessionDiagnostic<'a, !>) -> ! { + pub fn emit_fatal<'a>(&'a self, fatal: impl DiagnosticHandler<'a, !>) -> ! { self.parse_sess.emit_fatal(fatal) } #[inline] diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs index dc7078d9ada3c..595f539240d02 100644 --- a/compiler/rustc_trait_selection/src/errors.rs +++ b/compiler/rustc_trait_selection/src/errors.rs @@ -1,4 +1,4 @@ -use rustc_errors::{fluent, ErrorGuaranteed, Handler, SessionDiagnostic}; +use rustc_errors::{fluent, DiagnosticHandler, ErrorGuaranteed, Handler}; use rustc_macros::SessionDiagnostic; use rustc_middle::ty::{PolyTraitRef, Ty, Unevaluated}; use rustc_session::Limit; @@ -66,7 +66,7 @@ pub struct NegativePositiveConflict<'a> { pub positive_impl_span: Result, } -impl SessionDiagnostic<'_> for NegativePositiveConflict<'_> { +impl DiagnosticHandler<'_> for NegativePositiveConflict<'_> { fn into_diagnostic( self, handler: &Handler, diff --git a/compiler/rustc_typeck/src/errors.rs b/compiler/rustc_typeck/src/errors.rs index ed4c4f688bf18..0704177e7136e 100644 --- a/compiler/rustc_typeck/src/errors.rs +++ b/compiler/rustc_typeck/src/errors.rs @@ -1,5 +1,5 @@ //! Errors emitted by typeck. -use rustc_errors::SessionDiagnostic; +use rustc_errors::DiagnosticHandler; use rustc_errors::{error_code, Applicability, DiagnosticBuilder, ErrorGuaranteed, Handler}; use rustc_macros::{LintDiagnostic, SessionDiagnostic, SessionSubdiagnostic}; use rustc_middle::ty::Ty; @@ -250,7 +250,7 @@ pub struct MissingTypeParams { } // Manual implementation of `SessionDiagnostic` to be able to call `span_to_snippet`. -impl<'a> SessionDiagnostic<'a> for MissingTypeParams { +impl<'a> DiagnosticHandler<'a> for MissingTypeParams { fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> { let mut err = handler.struct_span_err_with_code( self.span, diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.rs b/src/test/ui-fulldeps/internal-lints/diagnostics.rs index 3b31a290449c9..69f69fbc78e72 100644 --- a/src/test/ui-fulldeps/internal-lints/diagnostics.rs +++ b/src/test/ui-fulldeps/internal-lints/diagnostics.rs @@ -12,7 +12,8 @@ extern crate rustc_session; extern crate rustc_span; use rustc_errors::{ - AddSubdiagnostic, SessionDiagnostic, Diagnostic, DiagnosticBuilder, ErrorGuaranteed, Handler, fluent + AddSubdiagnostic, DiagnosticHandler, Diagnostic, DiagnosticBuilder, + ErrorGuaranteed, Handler, fluent }; use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic}; use rustc_span::Span; @@ -33,7 +34,7 @@ struct Note { pub struct UntranslatableInSessionDiagnostic; -impl<'a> SessionDiagnostic<'a, ErrorGuaranteed> for UntranslatableInSessionDiagnostic { +impl<'a> DiagnosticHandler<'a, ErrorGuaranteed> for UntranslatableInSessionDiagnostic { fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> { handler.struct_err("untranslatable diagnostic") //~^ ERROR diagnostics should be created using translatable messages @@ -42,7 +43,7 @@ impl<'a> SessionDiagnostic<'a, ErrorGuaranteed> for UntranslatableInSessionDiagn pub struct TranslatableInSessionDiagnostic; -impl<'a> SessionDiagnostic<'a, ErrorGuaranteed> for TranslatableInSessionDiagnostic { +impl<'a> DiagnosticHandler<'a, ErrorGuaranteed> for TranslatableInSessionDiagnostic { fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> { handler.struct_err(fluent::parser::expect_path) } @@ -67,10 +68,10 @@ impl AddSubdiagnostic for TranslatableInAddSubdiagnostic { pub fn make_diagnostics<'a>(handler: &'a Handler) { let _diag = handler.struct_err(fluent::parser::expect_path); - //~^ ERROR diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls + //~^ ERROR diagnostics should only be created in `DiagnosticHandler`/`AddSubdiagnostic` impls let _diag = handler.struct_err("untranslatable diagnostic"); - //~^ ERROR diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls + //~^ ERROR diagnostics should only be created in `DiagnosticHandler`/`AddSubdiagnostic` impls //~^^ ERROR diagnostics should be created using translatable messages } diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr index e5c5bc2e9987e..e9c4907a859fe 100644 --- a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr +++ b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr @@ -16,7 +16,7 @@ error: diagnostics should be created using translatable messages LL | diag.note("untranslatable diagnostic"); | ^^^^ -error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls +error: diagnostics should only be created in `DiagnosticHandler`/`AddSubdiagnostic` impls --> $DIR/diagnostics.rs:70:25 | LL | let _diag = handler.struct_err(fluent::parser::expect_path); @@ -28,7 +28,7 @@ note: the lint level is defined here LL | #![deny(rustc::diagnostic_outside_of_impl)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls +error: diagnostics should only be created in `DiagnosticHandler`/`AddSubdiagnostic` impls --> $DIR/diagnostics.rs:73:25 | LL | let _diag = handler.struct_err("untranslatable diagnostic");