From f7e3d05aa7e012402269aa02fd0c628445465b86 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 30 Nov 2023 13:50:36 +1100 Subject: Inline and remove `DiagnosticBuilder::new_diagnostic_fatal`. It has a single call site. --- compiler/rustc_errors/src/diagnostic_builder.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'compiler/rustc_errors') diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs index 85acf8ab5aa..3823a1707ec 100644 --- a/compiler/rustc_errors/src/diagnostic_builder.rs +++ b/compiler/rustc_errors/src/diagnostic_builder.rs @@ -351,18 +351,10 @@ impl<'a> DiagnosticBuilder<'a, !> { /// `struct_*` methods on [`Handler`]. #[track_caller] pub(crate) fn new_fatal(handler: &'a Handler, message: impl Into) -> Self { - let diagnostic = Diagnostic::new_with_code(Level::Fatal, None, message); - Self::new_diagnostic_fatal(handler, diagnostic) - } - - /// Creates a new `DiagnosticBuilder` with an already constructed - /// diagnostic. - pub(crate) fn new_diagnostic_fatal(handler: &'a Handler, diagnostic: Diagnostic) -> Self { - debug!("Created new diagnostic"); Self { inner: DiagnosticBuilderInner { state: DiagnosticBuilderState::Emittable(handler), - diagnostic: Box::new(diagnostic), + diagnostic: Box::new(Diagnostic::new_with_code(Level::Fatal, None, message)), }, _marker: PhantomData, } -- cgit 1.4.1-3-g733a5