Refactor rustc lint API
This commit is contained in:
parent
65445a571c
commit
a8f7e244b7
64 changed files with 1760 additions and 1555 deletions
|
@ -1,6 +1,6 @@
|
|||
use crate::snippet::Style;
|
||||
use crate::{
|
||||
CodeSuggestion, DiagnosticMessage, EmissionGuarantee, Level, LintDiagnosticBuilder, MultiSpan,
|
||||
CodeSuggestion, DiagnosticBuilder, DiagnosticMessage, EmissionGuarantee, Level, MultiSpan,
|
||||
SubdiagnosticMessage, Substitution, SubstitutionPart, SuggestionStyle,
|
||||
};
|
||||
use rustc_ast as ast;
|
||||
|
@ -209,7 +209,12 @@ pub trait AddToDiagnostic {
|
|||
#[rustc_diagnostic_item = "DecorateLint"]
|
||||
pub trait DecorateLint<'a, G: EmissionGuarantee> {
|
||||
/// Decorate and emit a lint.
|
||||
fn decorate_lint(self, diag: LintDiagnosticBuilder<'a, G>);
|
||||
fn decorate_lint<'b>(
|
||||
self,
|
||||
diag: &'b mut DiagnosticBuilder<'a, G>,
|
||||
) -> &'b mut DiagnosticBuilder<'a, G>;
|
||||
|
||||
fn msg(&self) -> DiagnosticMessage;
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
|
|
|
@ -30,7 +30,7 @@ use rustc_data_structures::stable_hasher::StableHasher;
|
|||
use rustc_data_structures::sync::{self, Lock, Lrc};
|
||||
use rustc_data_structures::AtomicRef;
|
||||
pub use rustc_error_messages::{
|
||||
fallback_fluent_bundle, fluent, fluent_bundle, DiagnosticMessage, FluentBundle,
|
||||
fallback_fluent_bundle, fluent, fluent_bundle, DelayDm, DiagnosticMessage, FluentBundle,
|
||||
LanguageIdentifier, LazyFallbackBundle, MultiSpan, SpanLabel, SubdiagnosticMessage,
|
||||
DEFAULT_LOCALE_RESOURCES,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue