@@ -4,9 +4,9 @@ use rustc_errors::{
44 MultiSpan , SubdiagnosticMessage ,
55} ;
66use rustc_hir as hir;
7- use rustc_hir:: { FnRetTy , Ty } ;
7+ use rustc_hir:: FnRetTy ;
88use rustc_macros:: { Diagnostic , Subdiagnostic } ;
9- use rustc_middle:: ty:: { Region , TyCtxt } ;
9+ use rustc_middle:: ty:: { Region , Ty , TyCtxt } ;
1010use rustc_span:: symbol:: kw;
1111use rustc_span:: Symbol ;
1212use rustc_span:: { symbol:: Ident , BytePos , Span } ;
@@ -522,7 +522,7 @@ pub struct MismatchedStaticLifetime<'a> {
522522 pub implicit_static_lifetimes : Vec < ImplicitStaticLifetimeSubdiag > ,
523523}
524524
525- #[ derive( SessionDiagnostic ) ]
525+ #[ derive( Diagnostic ) ]
526526#[ diag( infer:: explicit_lifetime_required, code = "E0621" ) ]
527527pub struct ExplicitLifetimeRequired < ' a > {
528528 #[ primary_span]
@@ -542,7 +542,7 @@ pub struct ExplicitLifetimeRequired<'a> {
542542 pub new_ty : Ty < ' a > ,
543543}
544544
545- #[ derive( SessionSubdiagnostic ) ]
545+ #[ derive( Subdiagnostic ) ]
546546pub enum ActualImplExplNotes {
547547 // Field names have to be different across all variants
548548 #[ note( infer:: actual_impl_expl_1) ]
@@ -565,7 +565,7 @@ pub enum ActualImplExplNotes {
565565 } ,
566566}
567567
568- #[ derive( SessionDiagnostic ) ]
568+ #[ derive( Diagnostic ) ]
569569#[ diag( infer:: trait_placeholder_mismatch) ]
570570pub struct TraitPlaceholderMismatch {
571571 #[ primary_span]
@@ -587,7 +587,7 @@ pub struct ConsiderBorrowingParamHelp {
587587 pub spans : Vec < Span > ,
588588}
589589
590- impl AddSubdiagnostic for ConsiderBorrowingParamHelp {
590+ impl AddToDiagnostic for ConsiderBorrowingParamHelp {
591591 fn add_to_diagnostic ( self , diag : & mut rustc_errors:: Diagnostic ) {
592592 let mut type_param_span: MultiSpan = self . spans . clone ( ) . into ( ) ;
593593 for & span in & self . spans {
@@ -597,11 +597,11 @@ impl AddSubdiagnostic for ConsiderBorrowingParamHelp {
597597 }
598598}
599599
600- #[ derive( SessionSubdiagnostic ) ]
600+ #[ derive( Subdiagnostic ) ]
601601#[ help( infer:: tid_rel_help) ]
602602pub struct RelationshipHelp ;
603603
604- #[ derive( SessionDiagnostic ) ]
604+ #[ derive( Diagnostic ) ]
605605#[ diag( infer:: trait_impl_diff) ]
606606pub struct TraitImplDiff {
607607 #[ primary_span]
@@ -626,7 +626,7 @@ pub struct DynTraitConstraintSuggestion {
626626 pub ident : Ident ,
627627}
628628
629- impl AddSubdiagnostic for DynTraitConstraintSuggestion {
629+ impl AddToDiagnostic for DynTraitConstraintSuggestion {
630630 fn add_to_diagnostic ( self , diag : & mut rustc_errors:: Diagnostic ) {
631631 let mut multi_span: MultiSpan = vec ! [ self . span] . into ( ) ;
632632 multi_span. push_span_label ( self . span , fluent:: infer:: dtcs_has_lifetime_req_label) ;
@@ -641,7 +641,7 @@ impl AddSubdiagnostic for DynTraitConstraintSuggestion {
641641 }
642642}
643643
644- #[ derive( SessionDiagnostic ) ]
644+ #[ derive( Diagnostic ) ]
645645#[ diag( infer:: but_calling_introduces, code = "E0772" ) ]
646646pub struct ButCallingIntroduces {
647647 #[ label( infer:: label1) ]
@@ -667,7 +667,7 @@ pub struct ReqIntroducedLocations {
667667 pub add_label : bool ,
668668}
669669
670- impl AddSubdiagnostic for ReqIntroducedLocations {
670+ impl AddToDiagnostic for ReqIntroducedLocations {
671671 fn add_to_diagnostic ( mut self , diag : & mut rustc_errors:: Diagnostic ) {
672672 for sp in self . spans {
673673 self . span . push_span_label ( sp, fluent:: infer:: ril_introduced_here) ;
@@ -685,15 +685,15 @@ pub struct MoreTargeted {
685685 pub ident : Symbol ,
686686}
687687
688- impl AddSubdiagnostic for MoreTargeted {
688+ impl AddToDiagnostic for MoreTargeted {
689689 fn add_to_diagnostic ( self , diag : & mut rustc_errors:: Diagnostic ) {
690690 diag. code ( rustc_errors:: error_code!( E0772 ) ) ;
691691 diag. set_primary_message ( fluent:: infer:: more_targeted) ;
692692 diag. set_arg ( "ident" , self . ident ) ;
693693 }
694694}
695695
696- #[ derive( SessionDiagnostic ) ]
696+ #[ derive( Diagnostic ) ]
697697#[ diag( infer:: but_needs_to_satisfy, code = "E0759" ) ]
698698pub struct ButNeedsToSatisfy {
699699 #[ primary_span]
0 commit comments