Skip to content

Commit f7e3d05

Browse files
committed
Inline and remove DiagnosticBuilder::new_diagnostic_fatal.
It has a single call site.
1 parent c263ccf commit f7e3d05

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,18 +351,10 @@ impl<'a> DiagnosticBuilder<'a, !> {
351351
/// `struct_*` methods on [`Handler`].
352352
#[track_caller]
353353
pub(crate) fn new_fatal(handler: &'a Handler, message: impl Into<DiagnosticMessage>) -> Self {
354-
let diagnostic = Diagnostic::new_with_code(Level::Fatal, None, message);
355-
Self::new_diagnostic_fatal(handler, diagnostic)
356-
}
357-
358-
/// Creates a new `DiagnosticBuilder` with an already constructed
359-
/// diagnostic.
360-
pub(crate) fn new_diagnostic_fatal(handler: &'a Handler, diagnostic: Diagnostic) -> Self {
361-
debug!("Created new diagnostic");
362354
Self {
363355
inner: DiagnosticBuilderInner {
364356
state: DiagnosticBuilderState::Emittable(handler),
365-
diagnostic: Box::new(diagnostic),
357+
diagnostic: Box::new(Diagnostic::new_with_code(Level::Fatal, None, message)),
366358
},
367359
_marker: PhantomData,
368360
}

0 commit comments

Comments
 (0)