@@ -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 ( ) ;
@@ -824,11 +816,7 @@ pub(crate) struct HiddenUnicodeCodepointsDiagLabels {
824
816
}
825
817
826
818
impl Subdiagnostic for HiddenUnicodeCodepointsDiagLabels {
827
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
828
- self ,
829
- diag : & mut Diag < ' _ , G > ,
830
- _f : & F ,
831
- ) {
819
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
832
820
for ( c, span) in self . spans {
833
821
diag. span_label ( span, format ! ( "{c:?}" ) ) ;
834
822
}
@@ -842,11 +830,7 @@ pub(crate) enum HiddenUnicodeCodepointsDiagSub {
842
830
843
831
// Used because of multiple multipart_suggestion and note
844
832
impl Subdiagnostic for HiddenUnicodeCodepointsDiagSub {
845
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
846
- self ,
847
- diag : & mut Diag < ' _ , G > ,
848
- _f : & F ,
849
- ) {
833
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
850
834
match self {
851
835
HiddenUnicodeCodepointsDiagSub :: Escape { spans } => {
852
836
diag. multipart_suggestion_with_style (
@@ -1015,11 +999,7 @@ pub(crate) struct NonBindingLetSub {
1015
999
}
1016
1000
1017
1001
impl Subdiagnostic for NonBindingLetSub {
1018
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
1019
- self ,
1020
- diag : & mut Diag < ' _ , G > ,
1021
- _f : & F ,
1022
- ) {
1002
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
1023
1003
let can_suggest_binding = self . drop_fn_start_end . is_some ( ) || !self . is_assign_desugar ;
1024
1004
1025
1005
if can_suggest_binding {
@@ -1303,11 +1283,7 @@ pub(crate) enum NonSnakeCaseDiagSub {
1303
1283
}
1304
1284
1305
1285
impl Subdiagnostic for NonSnakeCaseDiagSub {
1306
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
1307
- self ,
1308
- diag : & mut Diag < ' _ , G > ,
1309
- _f : & F ,
1310
- ) {
1286
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
1311
1287
match self {
1312
1288
NonSnakeCaseDiagSub :: Label { span } => {
1313
1289
diag. span_label ( span, fluent:: lint_label) ;
@@ -1629,11 +1605,7 @@ pub(crate) enum OverflowingBinHexSign {
1629
1605
}
1630
1606
1631
1607
impl Subdiagnostic for OverflowingBinHexSign {
1632
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
1633
- self ,
1634
- diag : & mut Diag < ' _ , G > ,
1635
- _f : & F ,
1636
- ) {
1608
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
1637
1609
match self {
1638
1610
OverflowingBinHexSign :: Positive => {
1639
1611
diag. note ( fluent:: lint_positive_note) ;
0 commit comments