From d4933aaf1fe182e32058928354b86b92f539c19b Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Sun, 3 Dec 2023 22:01:57 +1100 Subject: Inline and remove `DiagnosticBuilder::new_diagnostic_*` functions. They each have a single call site. --- compiler/rustc_errors/src/diagnostic_builder.rs | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'compiler/rustc_errors/src') diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs index 3823a1707ec..df40dda7f89 100644 --- a/compiler/rustc_errors/src/diagnostic_builder.rs +++ b/compiler/rustc_errors/src/diagnostic_builder.rs @@ -254,13 +254,6 @@ impl<'a> DiagnosticBuilder<'a, Noted> { /// `struct_*` methods on [`Handler`]. pub(crate) fn new_note(handler: &'a Handler, message: impl Into) -> Self { let diagnostic = Diagnostic::new_with_code(Level::Note, None, message); - Self::new_diagnostic_note(handler, diagnostic) - } - - /// Creates a new `DiagnosticBuilder` with an already constructed - /// diagnostic. - pub(crate) fn new_diagnostic_note(handler: &'a Handler, diagnostic: Diagnostic) -> Self { - debug!("Created new diagnostic"); Self { inner: DiagnosticBuilderInner { state: DiagnosticBuilderState::Emittable(handler), @@ -305,13 +298,6 @@ impl<'a> DiagnosticBuilder<'a, Bug> { #[track_caller] pub(crate) fn new_bug(handler: &'a Handler, message: impl Into) -> Self { let diagnostic = Diagnostic::new_with_code(Level::Bug, None, message); - Self::new_diagnostic_bug(handler, diagnostic) - } - - /// Creates a new `DiagnosticBuilder` with an already constructed - /// diagnostic. - pub(crate) fn new_diagnostic_bug(handler: &'a Handler, diagnostic: Diagnostic) -> Self { - debug!("Created new diagnostic bug"); Self { inner: DiagnosticBuilderInner { state: DiagnosticBuilderState::Emittable(handler), @@ -394,16 +380,6 @@ impl<'a> DiagnosticBuilder<'a, rustc_span::fatal_error::FatalError> { message: impl Into, ) -> Self { let diagnostic = Diagnostic::new_with_code(Level::Fatal, None, message); - Self::new_diagnostic_almost_fatal(handler, diagnostic) - } - - /// Creates a new `DiagnosticBuilder` with an already constructed - /// diagnostic. - pub(crate) fn new_diagnostic_almost_fatal( - handler: &'a Handler, - diagnostic: Diagnostic, - ) -> Self { - debug!("Created new diagnostic"); Self { inner: DiagnosticBuilderInner { state: DiagnosticBuilderState::Emittable(handler), -- cgit 1.4.1-3-g733a5