UPDATE - rename SessionSubdiagnostic macro to Subdiagnostic
Also renames: - sym::AddSubdiagnostic to sym:: Subdiagnostic - rustc_diagnostic_item = "AddSubdiagnostic" to rustc_diagnostic_item = "Subdiagnostic"
This commit is contained in:
parent
a3396b2070
commit
5f91719f75
24 changed files with 130 additions and 128 deletions
|
@ -1,5 +1,5 @@
|
|||
use rustc_errors::{fluent, AddToDiagnostic, IntoDiagnostic, ErrorGuaranteed, Handler};
|
||||
use rustc_macros::{Diagnostic, SessionSubdiagnostic};
|
||||
use rustc_macros::{Diagnostic, Subdiagnostic};
|
||||
use rustc_session::lint::Level;
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
||||
|
@ -51,7 +51,7 @@ pub struct MalformedAttribute {
|
|||
pub sub: MalformedAttributeSub,
|
||||
}
|
||||
|
||||
#[derive(SessionSubdiagnostic)]
|
||||
#[derive(Subdiagnostic)]
|
||||
pub enum MalformedAttributeSub {
|
||||
#[label(lint::bad_attribute_argument)]
|
||||
BadAttributeArgument(#[primary_span] Span),
|
||||
|
|
|
@ -404,7 +404,7 @@ impl LateLintPass<'_> for Diagnostics {
|
|||
let Impl { of_trait: Some(of_trait), .. } = impl_ &&
|
||||
let Some(def_id) = of_trait.trait_def_id() &&
|
||||
let Some(name) = cx.tcx.get_diagnostic_name(def_id) &&
|
||||
matches!(name, sym::Diagnostic | sym::AddSubdiagnostic | sym::DecorateLint)
|
||||
matches!(name, sym::Diagnostic | sym::Subdiagnostic | sym::DecorateLint)
|
||||
{
|
||||
found_impl = true;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue