mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Remove LintDiagnosticBuilder
This commit is contained in:
parent
d028db9dbd
commit
b5b3ffe3fc
@ -629,27 +629,3 @@ macro_rules! struct_span_err {
|
||||
macro_rules! error_code {
|
||||
($code:ident) => {{ $crate::DiagnosticId::Error(stringify!($code).to_owned()) }};
|
||||
}
|
||||
|
||||
/// Wrapper around a `DiagnosticBuilder` for creating lints.
|
||||
pub struct LintDiagnosticBuilder<'a, G: EmissionGuarantee>(DiagnosticBuilder<'a, G>);
|
||||
|
||||
impl<'a, G: EmissionGuarantee> LintDiagnosticBuilder<'a, G> {
|
||||
#[rustc_lint_diagnostics]
|
||||
/// Return the inner `DiagnosticBuilder`, first setting the primary message to `msg`.
|
||||
pub fn build(mut self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'a, G> {
|
||||
self.0.set_primary_message(msg);
|
||||
self.0.set_is_lint();
|
||||
self.0
|
||||
}
|
||||
|
||||
/// Create a `LintDiagnosticBuilder` from some existing `DiagnosticBuilder`.
|
||||
pub fn new(err: DiagnosticBuilder<'a, G>) -> LintDiagnosticBuilder<'a, G> {
|
||||
LintDiagnosticBuilder(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> LintDiagnosticBuilder<'a, ErrorGuaranteed> {
|
||||
pub fn forget_guarantee(self) -> LintDiagnosticBuilder<'a, ()> {
|
||||
LintDiagnosticBuilder(self.0.forget_guarantee())
|
||||
}
|
||||
}
|
||||
|
@ -374,7 +374,7 @@ pub use diagnostic::{
|
||||
AddToDiagnostic, DecorateLint, Diagnostic, DiagnosticArg, DiagnosticArgFromDisplay,
|
||||
DiagnosticArgValue, DiagnosticId, DiagnosticStyledString, IntoDiagnosticArg, SubDiagnostic,
|
||||
};
|
||||
pub use diagnostic_builder::{DiagnosticBuilder, EmissionGuarantee, LintDiagnosticBuilder};
|
||||
pub use diagnostic_builder::{DiagnosticBuilder, EmissionGuarantee};
|
||||
use std::backtrace::Backtrace;
|
||||
|
||||
/// A handler deals with errors and other compiler output.
|
||||
|
Loading…
Reference in New Issue
Block a user