mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #153401 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
Migrationg of `LintDiagnostic` - part 7 Part of https://github.com/rust-lang/rust/issues/153099. This PR removes the `LintDiagnostic` trait and proc-macro. \o/ r? @JonathanBrouwer
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
use crate::{Diag, DiagCtxtHandle, Diagnostic, Level};
|
||||
|
||||
/// We can't implement `LintDiagnostic` for `BuiltinLintDiag`, because decorating some of its
|
||||
/// We can't implement `Diagnostic` for `BuiltinLintDiag`, because decorating some of its
|
||||
/// variants requires types we don't have yet. So, handle that case separately.
|
||||
pub enum DecorateDiagCompat {
|
||||
Dynamic(Box<dyn for<'a> FnOnce(DiagCtxtHandle<'a>, Level) -> Diag<'a, ()> + DynSend + 'static>),
|
||||
|
||||
@@ -138,14 +138,6 @@ pub trait Subdiagnostic
|
||||
fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>);
|
||||
}
|
||||
|
||||
/// Trait implemented by lint types. This should not be implemented manually. Instead, use
|
||||
/// `#[derive(LintDiagnostic)]` -- see [rustc_macros::LintDiagnostic].
|
||||
#[rustc_diagnostic_item = "LintDiagnostic"]
|
||||
pub trait LintDiagnostic<'a, G: EmissionGuarantee> {
|
||||
/// Decorate a lint with the information from this type.
|
||||
fn decorate_lint<'b>(self, diag: &'b mut Diag<'a, G>);
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Encodable, Decodable)]
|
||||
pub(crate) struct DiagLocation {
|
||||
file: Cow<'static, str>,
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
pub use decorate_diag::{BufferedEarlyLint, DecorateDiagCompat, LintBuffer};
|
||||
pub use diagnostic::{
|
||||
BugAbort, Diag, DiagInner, DiagStyledString, Diagnostic, EmissionGuarantee, FatalAbort,
|
||||
LintDiagnostic, StringPart, Subdiag, Subdiagnostic,
|
||||
StringPart, Subdiag, Subdiagnostic,
|
||||
};
|
||||
pub use diagnostic_impls::{
|
||||
DiagSymbolList, ElidedLifetimeInPathSubdiag, ExpectedLifetimeParameter,
|
||||
|
||||
Reference in New Issue
Block a user