@@ -33,7 +33,7 @@ use rustc_hir::{
3333 Item , ItemKind , MethodKind , Node , ParamName , PartialConstStability , Safety , Stability ,
3434 StabilityLevel , Target , TraitItem , find_attr,
3535} ;
36- use rustc_macros:: LintDiagnostic ;
36+ use rustc_macros:: Diagnostic ;
3737use rustc_middle:: hir:: nested_filter;
3838use rustc_middle:: middle:: resolve_bound_vars:: ObjectLifetimeDefault ;
3939use rustc_middle:: query:: Providers ;
@@ -57,18 +57,18 @@ use tracing::debug;
5757
5858use crate :: errors;
5959
60- #[ derive( LintDiagnostic ) ]
60+ #[ derive( Diagnostic ) ]
6161#[ diag( "`#[diagnostic::on_unimplemented]` can only be applied to trait definitions" ) ]
6262struct DiagnosticOnUnimplementedOnlyForTraits ;
6363
64- #[ derive( LintDiagnostic ) ]
64+ #[ derive( Diagnostic ) ]
6565#[ diag( "`#[diagnostic::on_const]` can only be applied to trait impls" ) ]
6666struct DiagnosticOnConstOnlyForTraitImpls {
6767 #[ label( "not a trait impl" ) ]
6868 item_span : Span ,
6969}
7070
71- #[ derive( LintDiagnostic ) ]
71+ #[ derive( Diagnostic ) ]
7272#[ diag( "`#[diagnostic::on_const]` can only be applied to non-const trait impls" ) ]
7373struct DiagnosticOnConstOnlyForNonConstTraitImpls {
7474 #[ label( "this is a const trait impl" ) ]
@@ -453,7 +453,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
453453 . span_until_char ( attr_span, '[' )
454454 . shrink_to_hi ( ) ;
455455
456- self . tcx . emit_node_span_lint (
456+ self . tcx . emit_diag_node_span_lint (
457457 UNUSED_ATTRIBUTES ,
458458 hir_id,
459459 attr. span ,
@@ -464,7 +464,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
464464 } ,
465465 )
466466 }
467- ast:: AttrStyle :: Inner => self . tcx . emit_node_span_lint (
467+ ast:: AttrStyle :: Inner => self . tcx . emit_diag_node_span_lint (
468468 UNUSED_ATTRIBUTES ,
469469 hir_id,
470470 attr. span ,
@@ -595,7 +595,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
595595 if _impl. of_trait. is_none( )
596596 )
597597 {
598- self . tcx . emit_node_span_lint (
598+ self . tcx . emit_diag_node_span_lint (
599599 MISPLACED_DIAGNOSTIC_ATTRIBUTES ,
600600 hir_id,
601601 attr_span,
@@ -613,7 +613,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
613613 directive : Option < & Directive > ,
614614 ) {
615615 if !matches ! ( target, Target :: Trait ) {
616- self . tcx . emit_node_span_lint (
616+ self . tcx . emit_diag_node_span_lint (
617617 MISPLACED_DIAGNOSTIC_ATTRIBUTES ,
618618 hir_id,
619619 attr_span,
@@ -668,7 +668,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
668668 ItemLike :: Item ( it) => match it. expect_impl ( ) . constness {
669669 Constness :: Const => {
670670 let item_span = self . tcx . hir_span ( hir_id) ;
671- self . tcx . emit_node_span_lint (
671+ self . tcx . emit_diag_node_span_lint (
672672 MISPLACED_DIAGNOSTIC_ATTRIBUTES ,
673673 hir_id,
674674 attr_span,
@@ -682,7 +682,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
682682 }
683683 }
684684 let item_span = self . tcx . hir_span ( hir_id) ;
685- self . tcx . emit_node_span_lint (
685+ self . tcx . emit_diag_node_span_lint (
686686 MISPLACED_DIAGNOSTIC_ATTRIBUTES ,
687687 hir_id,
688688 attr_span,
@@ -707,11 +707,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
707707 let attrs = self . tcx . codegen_fn_attrs ( did) ;
708708 // Not checking naked as `#[inline]` is forbidden for naked functions anyways.
709709 if attrs. contains_extern_indicator ( ) {
710- self . tcx . emit_node_span_lint (
710+ self . tcx . emit_diag_node_span_lint (
711711 UNUSED_ATTRIBUTES ,
712712 hir_id,
713713 attr_span,
714- errors:: InlineIgnoredForExported { } ,
714+ errors:: InlineIgnoredForExported ,
715715 ) ;
716716 }
717717 }
@@ -1058,7 +1058,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
10581058 match target {
10591059 Target :: Use | Target :: ExternCrate => { }
10601060 _ => {
1061- self . tcx . emit_node_span_lint (
1061+ self . tcx . emit_diag_node_span_lint (
10621062 INVALID_DOC_ATTRIBUTES ,
10631063 hir_id,
10641064 span,
@@ -1073,7 +1073,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
10731073
10741074 fn check_doc_masked ( & self , span : Span , hir_id : HirId , target : Target ) {
10751075 if target != Target :: ExternCrate {
1076- self . tcx . emit_node_span_lint (
1076+ self . tcx . emit_diag_node_span_lint (
10771077 INVALID_DOC_ATTRIBUTES ,
10781078 hir_id,
10791079 span,
@@ -1086,7 +1086,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
10861086 }
10871087
10881088 if self . tcx . extern_mod_stmt_cnum ( hir_id. owner . def_id ) . is_none ( ) {
1089- self . tcx . emit_node_span_lint (
1089+ self . tcx . emit_diag_node_span_lint (
10901090 INVALID_DOC_ATTRIBUTES ,
10911091 hir_id,
10921092 span,
@@ -1238,7 +1238,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
12381238 return ;
12391239 }
12401240
1241- self . tcx . emit_node_span_lint (
1241+ self . tcx . emit_diag_node_span_lint (
12421242 UNUSED_ATTRIBUTES ,
12431243 hir_id,
12441244 attr_span,
@@ -1475,7 +1475,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
14751475 if let ItemLike :: Item ( item) = item { is_c_like_enum ( item) } else { false }
14761476 } ) )
14771477 {
1478- self . tcx . emit_node_span_lint (
1478+ self . tcx . emit_diag_node_span_lint (
14791479 CONFLICTING_REPR_HINTS ,
14801480 hir_id,
14811481 hint_spans. collect :: < Vec < Span > > ( ) ,
@@ -1571,7 +1571,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
15711571 if self . tcx . def_kind ( self . tcx . local_parent ( hir_id. owner . def_id ) )
15721572 == DefKind :: Impl { of_trait : true } =>
15731573 {
1574- self . tcx . emit_node_span_lint (
1574+ self . tcx . emit_diag_node_span_lint (
15751575 UNUSED_ATTRIBUTES ,
15761576 hir_id,
15771577 attr_span,
@@ -1592,7 +1592,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
15921592 let is_decl_macro = !macro_definition. macro_rules ;
15931593
15941594 if is_decl_macro {
1595- self . tcx . emit_node_span_lint (
1595+ self . tcx . emit_diag_node_span_lint (
15961596 UNUSED_ATTRIBUTES ,
15971597 hir_id,
15981598 attr_span,
@@ -1644,7 +1644,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
16441644 . span_until_char ( attr_span, '[' )
16451645 . shrink_to_hi ( ) ;
16461646
1647- self . tcx . emit_node_span_lint (
1647+ self . tcx . emit_diag_node_span_lint (
16481648 UNUSED_ATTRIBUTES ,
16491649 hir_id,
16501650 attr_span,
@@ -1655,7 +1655,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
16551655 } ,
16561656 )
16571657 }
1658- Some ( ast:: AttrStyle :: Inner ) | None => self . tcx . emit_node_span_lint (
1658+ Some ( ast:: AttrStyle :: Inner ) | None => self . tcx . emit_diag_node_span_lint (
16591659 UNUSED_ATTRIBUTES ,
16601660 hir_id,
16611661 attr. span ( ) ,
@@ -1681,7 +1681,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
16811681 return ;
16821682 } ;
16831683
1684- self . tcx . emit_node_span_lint (
1684+ self . tcx . emit_diag_node_span_lint (
16851685 UNUSED_ATTRIBUTES ,
16861686 hir_id,
16871687 attr. span ( ) ,
@@ -1849,7 +1849,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
18491849 "#[export_name]"
18501850 } ;
18511851
1852- self . tcx . emit_node_span_lint (
1852+ self . tcx . emit_diag_node_span_lint (
18531853 lint:: builtin:: UNUSED_ATTRIBUTES ,
18541854 hir_id,
18551855 no_mangle_span,
@@ -2193,7 +2193,7 @@ fn check_duplicates(
21932193 } else {
21942194 ( attr_span, * entry. get ( ) )
21952195 } ;
2196- tcx. emit_node_span_lint (
2196+ tcx. emit_diag_node_span_lint (
21972197 UNUSED_ATTRIBUTES ,
21982198 hir_id,
21992199 this,
0 commit comments