Skip to content

Commit b5b3ffe

Browse files
committed
Remove LintDiagnosticBuilder
1 parent d028db9 commit b5b3ffe

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

-24
Original file line numberDiff line numberDiff line change
@@ -629,27 +629,3 @@ macro_rules! struct_span_err {
629629
macro_rules! error_code {
630630
($code:ident) => {{ $crate::DiagnosticId::Error(stringify!($code).to_owned()) }};
631631
}
632-
633-
/// Wrapper around a `DiagnosticBuilder` for creating lints.
634-
pub struct LintDiagnosticBuilder<'a, G: EmissionGuarantee>(DiagnosticBuilder<'a, G>);
635-
636-
impl<'a, G: EmissionGuarantee> LintDiagnosticBuilder<'a, G> {
637-
#[rustc_lint_diagnostics]
638-
/// Return the inner `DiagnosticBuilder`, first setting the primary message to `msg`.
639-
pub fn build(mut self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'a, G> {
640-
self.0.set_primary_message(msg);
641-
self.0.set_is_lint();
642-
self.0
643-
}
644-
645-
/// Create a `LintDiagnosticBuilder` from some existing `DiagnosticBuilder`.
646-
pub fn new(err: DiagnosticBuilder<'a, G>) -> LintDiagnosticBuilder<'a, G> {
647-
LintDiagnosticBuilder(err)
648-
}
649-
}
650-
651-
impl<'a> LintDiagnosticBuilder<'a, ErrorGuaranteed> {
652-
pub fn forget_guarantee(self) -> LintDiagnosticBuilder<'a, ()> {
653-
LintDiagnosticBuilder(self.0.forget_guarantee())
654-
}
655-
}

compiler/rustc_errors/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ pub use diagnostic::{
374374
AddToDiagnostic, DecorateLint, Diagnostic, DiagnosticArg, DiagnosticArgFromDisplay,
375375
DiagnosticArgValue, DiagnosticId, DiagnosticStyledString, IntoDiagnosticArg, SubDiagnostic,
376376
};
377-
pub use diagnostic_builder::{DiagnosticBuilder, EmissionGuarantee, LintDiagnosticBuilder};
377+
pub use diagnostic_builder::{DiagnosticBuilder, EmissionGuarantee};
378378
use std::backtrace::Backtrace;
379379

380380
/// A handler deals with errors and other compiler output.

0 commit comments

Comments
 (0)