about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-11-30 13:50:36 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-12-02 08:58:24 +1100
commitf7e3d05aa7e012402269aa02fd0c628445465b86 (patch)
tree07b9cb7822320cb29b0cbda8f4fde330ad58d351 /compiler/rustc_errors/src
parentc263ccf18571b4a3791e4c50dcae5473d6f9593a (diff)
downloadrust-f7e3d05aa7e012402269aa02fd0c628445465b86.tar.gz
rust-f7e3d05aa7e012402269aa02fd0c628445465b86.zip
Inline and remove `DiagnosticBuilder::new_diagnostic_fatal`.
It has a single call site.
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/diagnostic_builder.rs10
1 files changed, 1 insertions, 9 deletions
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<DiagnosticMessage>) -> 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,
         }