@@ -6,7 +6,7 @@ use rustc_abi::ExternAbi;
6
6
use rustc_errors:: codes:: * ;
7
7
use rustc_errors:: {
8
8
Applicability , Diag , DiagArgValue , DiagMessage , DiagStyledString , ElidedLifetimeInPathSubdiag ,
9
- EmissionGuarantee , LintDiagnostic , MultiSpan , SubdiagMessageOp , Subdiagnostic , SuggestionStyle ,
9
+ EmissionGuarantee , LintDiagnostic , MultiSpan , Subdiagnostic , SuggestionStyle ,
10
10
} ;
11
11
use rustc_hir:: def:: Namespace ;
12
12
use rustc_hir:: def_id:: DefId ;
@@ -449,11 +449,7 @@ pub(crate) struct BuiltinUnpermittedTypeInitSub {
449
449
}
450
450
451
451
impl Subdiagnostic for BuiltinUnpermittedTypeInitSub {
452
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
453
- self ,
454
- diag : & mut Diag < ' _ , G > ,
455
- _f : & F ,
456
- ) {
452
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
457
453
let mut err = self . err ;
458
454
loop {
459
455
if let Some ( span) = err. span {
@@ -504,11 +500,7 @@ pub(crate) struct BuiltinClashingExternSub<'a> {
504
500
}
505
501
506
502
impl Subdiagnostic for BuiltinClashingExternSub < ' _ > {
507
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
508
- self ,
509
- diag : & mut Diag < ' _ , G > ,
510
- _f : & F ,
511
- ) {
503
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
512
504
let mut expected_str = DiagStyledString :: new ( ) ;
513
505
expected_str. push ( self . expected . fn_sig ( self . tcx ) . to_string ( ) , false ) ;
514
506
let mut found_str = DiagStyledString :: new ( ) ;
@@ -808,11 +800,7 @@ pub(crate) struct HiddenUnicodeCodepointsDiagLabels {
808
800
}
809
801
810
802
impl Subdiagnostic for HiddenUnicodeCodepointsDiagLabels {
811
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
812
- self ,
813
- diag : & mut Diag < ' _ , G > ,
814
- _f : & F ,
815
- ) {
803
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
816
804
for ( c, span) in self . spans {
817
805
diag. span_label ( span, format ! ( "{c:?}" ) ) ;
818
806
}
@@ -826,11 +814,7 @@ pub(crate) enum HiddenUnicodeCodepointsDiagSub {
826
814
827
815
// Used because of multiple multipart_suggestion and note
828
816
impl Subdiagnostic for HiddenUnicodeCodepointsDiagSub {
829
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
830
- self ,
831
- diag : & mut Diag < ' _ , G > ,
832
- _f : & F ,
833
- ) {
817
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
834
818
match self {
835
819
HiddenUnicodeCodepointsDiagSub :: Escape { spans } => {
836
820
diag. multipart_suggestion_with_style (
@@ -994,11 +978,7 @@ pub(crate) struct NonBindingLetSub {
994
978
}
995
979
996
980
impl Subdiagnostic for NonBindingLetSub {
997
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
998
- self ,
999
- diag : & mut Diag < ' _ , G > ,
1000
- _f : & F ,
1001
- ) {
981
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
1002
982
let can_suggest_binding = self . drop_fn_start_end . is_some ( ) || !self . is_assign_desugar ;
1003
983
1004
984
if can_suggest_binding {
@@ -1282,11 +1262,7 @@ pub(crate) enum NonSnakeCaseDiagSub {
1282
1262
}
1283
1263
1284
1264
impl Subdiagnostic for NonSnakeCaseDiagSub {
1285
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
1286
- self ,
1287
- diag : & mut Diag < ' _ , G > ,
1288
- _f : & F ,
1289
- ) {
1265
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
1290
1266
match self {
1291
1267
NonSnakeCaseDiagSub :: Label { span } => {
1292
1268
diag. span_label ( span, fluent:: lint_label) ;
@@ -1608,11 +1584,7 @@ pub(crate) enum OverflowingBinHexSign {
1608
1584
}
1609
1585
1610
1586
impl Subdiagnostic for OverflowingBinHexSign {
1611
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
1612
- self ,
1613
- diag : & mut Diag < ' _ , G > ,
1614
- _f : & F ,
1615
- ) {
1587
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
1616
1588
match self {
1617
1589
OverflowingBinHexSign :: Positive => {
1618
1590
diag. note ( fluent:: lint_positive_note) ;
0 commit comments