@@ -4,9 +4,9 @@ use rustc_errors::{
4
4
MultiSpan , SubdiagnosticMessage ,
5
5
} ;
6
6
use rustc_hir as hir;
7
- use rustc_hir:: { FnRetTy , Ty } ;
7
+ use rustc_hir:: FnRetTy ;
8
8
use rustc_macros:: { Diagnostic , Subdiagnostic } ;
9
- use rustc_middle:: ty:: { Region , TyCtxt } ;
9
+ use rustc_middle:: ty:: { Region , Ty , TyCtxt } ;
10
10
use rustc_span:: symbol:: kw;
11
11
use rustc_span:: Symbol ;
12
12
use rustc_span:: { symbol:: Ident , BytePos , Span } ;
@@ -522,7 +522,7 @@ pub struct MismatchedStaticLifetime<'a> {
522
522
pub implicit_static_lifetimes : Vec < ImplicitStaticLifetimeSubdiag > ,
523
523
}
524
524
525
- #[ derive( SessionDiagnostic ) ]
525
+ #[ derive( Diagnostic ) ]
526
526
#[ diag( infer:: explicit_lifetime_required, code = "E0621" ) ]
527
527
pub struct ExplicitLifetimeRequired < ' a > {
528
528
#[ primary_span]
@@ -542,7 +542,7 @@ pub struct ExplicitLifetimeRequired<'a> {
542
542
pub new_ty : Ty < ' a > ,
543
543
}
544
544
545
- #[ derive( SessionSubdiagnostic ) ]
545
+ #[ derive( Subdiagnostic ) ]
546
546
pub enum ActualImplExplNotes {
547
547
// Field names have to be different across all variants
548
548
#[ note( infer:: actual_impl_expl_1) ]
@@ -565,7 +565,7 @@ pub enum ActualImplExplNotes {
565
565
} ,
566
566
}
567
567
568
- #[ derive( SessionDiagnostic ) ]
568
+ #[ derive( Diagnostic ) ]
569
569
#[ diag( infer:: trait_placeholder_mismatch) ]
570
570
pub struct TraitPlaceholderMismatch {
571
571
#[ primary_span]
@@ -587,7 +587,7 @@ pub struct ConsiderBorrowingParamHelp {
587
587
pub spans : Vec < Span > ,
588
588
}
589
589
590
- impl AddSubdiagnostic for ConsiderBorrowingParamHelp {
590
+ impl AddToDiagnostic for ConsiderBorrowingParamHelp {
591
591
fn add_to_diagnostic ( self , diag : & mut rustc_errors:: Diagnostic ) {
592
592
let mut type_param_span: MultiSpan = self . spans . clone ( ) . into ( ) ;
593
593
for & span in & self . spans {
@@ -597,11 +597,11 @@ impl AddSubdiagnostic for ConsiderBorrowingParamHelp {
597
597
}
598
598
}
599
599
600
- #[ derive( SessionSubdiagnostic ) ]
600
+ #[ derive( Subdiagnostic ) ]
601
601
#[ help( infer:: tid_rel_help) ]
602
602
pub struct RelationshipHelp ;
603
603
604
- #[ derive( SessionDiagnostic ) ]
604
+ #[ derive( Diagnostic ) ]
605
605
#[ diag( infer:: trait_impl_diff) ]
606
606
pub struct TraitImplDiff {
607
607
#[ primary_span]
@@ -626,7 +626,7 @@ pub struct DynTraitConstraintSuggestion {
626
626
pub ident : Ident ,
627
627
}
628
628
629
- impl AddSubdiagnostic for DynTraitConstraintSuggestion {
629
+ impl AddToDiagnostic for DynTraitConstraintSuggestion {
630
630
fn add_to_diagnostic ( self , diag : & mut rustc_errors:: Diagnostic ) {
631
631
let mut multi_span: MultiSpan = vec ! [ self . span] . into ( ) ;
632
632
multi_span. push_span_label ( self . span , fluent:: infer:: dtcs_has_lifetime_req_label) ;
@@ -641,7 +641,7 @@ impl AddSubdiagnostic for DynTraitConstraintSuggestion {
641
641
}
642
642
}
643
643
644
- #[ derive( SessionDiagnostic ) ]
644
+ #[ derive( Diagnostic ) ]
645
645
#[ diag( infer:: but_calling_introduces, code = "E0772" ) ]
646
646
pub struct ButCallingIntroduces {
647
647
#[ label( infer:: label1) ]
@@ -667,7 +667,7 @@ pub struct ReqIntroducedLocations {
667
667
pub add_label : bool ,
668
668
}
669
669
670
- impl AddSubdiagnostic for ReqIntroducedLocations {
670
+ impl AddToDiagnostic for ReqIntroducedLocations {
671
671
fn add_to_diagnostic ( mut self , diag : & mut rustc_errors:: Diagnostic ) {
672
672
for sp in self . spans {
673
673
self . span . push_span_label ( sp, fluent:: infer:: ril_introduced_here) ;
@@ -685,15 +685,15 @@ pub struct MoreTargeted {
685
685
pub ident : Symbol ,
686
686
}
687
687
688
- impl AddSubdiagnostic for MoreTargeted {
688
+ impl AddToDiagnostic for MoreTargeted {
689
689
fn add_to_diagnostic ( self , diag : & mut rustc_errors:: Diagnostic ) {
690
690
diag. code ( rustc_errors:: error_code!( E0772 ) ) ;
691
691
diag. set_primary_message ( fluent:: infer:: more_targeted) ;
692
692
diag. set_arg ( "ident" , self . ident ) ;
693
693
}
694
694
}
695
695
696
- #[ derive( SessionDiagnostic ) ]
696
+ #[ derive( Diagnostic ) ]
697
697
#[ diag( infer:: but_needs_to_satisfy, code = "E0759" ) ]
698
698
pub struct ButNeedsToSatisfy {
699
699
#[ primary_span]
0 commit comments