Skip to content

Commit d4933aa

Browse files
committed
Inline and remove DiagnosticBuilder::new_diagnostic_* functions.
They each have a single call site.
1 parent 114380d commit d4933aa

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,6 @@ impl<'a> DiagnosticBuilder<'a, Noted> {
254254
/// `struct_*` methods on [`Handler`].
255255
pub(crate) fn new_note(handler: &'a Handler, message: impl Into<DiagnosticMessage>) -> Self {
256256
let diagnostic = Diagnostic::new_with_code(Level::Note, None, message);
257-
Self::new_diagnostic_note(handler, diagnostic)
258-
}
259-
260-
/// Creates a new `DiagnosticBuilder` with an already constructed
261-
/// diagnostic.
262-
pub(crate) fn new_diagnostic_note(handler: &'a Handler, diagnostic: Diagnostic) -> Self {
263-
debug!("Created new diagnostic");
264257
Self {
265258
inner: DiagnosticBuilderInner {
266259
state: DiagnosticBuilderState::Emittable(handler),
@@ -305,13 +298,6 @@ impl<'a> DiagnosticBuilder<'a, Bug> {
305298
#[track_caller]
306299
pub(crate) fn new_bug(handler: &'a Handler, message: impl Into<DiagnosticMessage>) -> Self {
307300
let diagnostic = Diagnostic::new_with_code(Level::Bug, None, message);
308-
Self::new_diagnostic_bug(handler, diagnostic)
309-
}
310-
311-
/// Creates a new `DiagnosticBuilder` with an already constructed
312-
/// diagnostic.
313-
pub(crate) fn new_diagnostic_bug(handler: &'a Handler, diagnostic: Diagnostic) -> Self {
314-
debug!("Created new diagnostic bug");
315301
Self {
316302
inner: DiagnosticBuilderInner {
317303
state: DiagnosticBuilderState::Emittable(handler),
@@ -394,16 +380,6 @@ impl<'a> DiagnosticBuilder<'a, rustc_span::fatal_error::FatalError> {
394380
message: impl Into<DiagnosticMessage>,
395381
) -> Self {
396382
let diagnostic = Diagnostic::new_with_code(Level::Fatal, None, message);
397-
Self::new_diagnostic_almost_fatal(handler, diagnostic)
398-
}
399-
400-
/// Creates a new `DiagnosticBuilder` with an already constructed
401-
/// diagnostic.
402-
pub(crate) fn new_diagnostic_almost_fatal(
403-
handler: &'a Handler,
404-
diagnostic: Diagnostic,
405-
) -> Self {
406-
debug!("Created new diagnostic");
407383
Self {
408384
inner: DiagnosticBuilderInner {
409385
state: DiagnosticBuilderState::Emittable(handler),

0 commit comments

Comments
 (0)