@@ -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 (
@@ -999,11 +983,7 @@ pub(crate) struct NonBindingLetSub {
999
983
}
1000
984
1001
985
impl Subdiagnostic for NonBindingLetSub {
1002
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
1003
- self ,
1004
- diag : & mut Diag < ' _ , G > ,
1005
- _f : & F ,
1006
- ) {
986
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
1007
987
let can_suggest_binding = self . drop_fn_start_end . is_some ( ) || !self . is_assign_desugar ;
1008
988
1009
989
if can_suggest_binding {
@@ -1287,11 +1267,7 @@ pub(crate) enum NonSnakeCaseDiagSub {
1287
1267
}
1288
1268
1289
1269
impl Subdiagnostic for NonSnakeCaseDiagSub {
1290
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
1291
- self ,
1292
- diag : & mut Diag < ' _ , G > ,
1293
- _f : & F ,
1294
- ) {
1270
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
1295
1271
match self {
1296
1272
NonSnakeCaseDiagSub :: Label { span } => {
1297
1273
diag. span_label ( span, fluent:: lint_label) ;
@@ -1613,11 +1589,7 @@ pub(crate) enum OverflowingBinHexSign {
1613
1589
}
1614
1590
1615
1591
impl Subdiagnostic for OverflowingBinHexSign {
1616
- fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
1617
- self ,
1618
- diag : & mut Diag < ' _ , G > ,
1619
- _f : & F ,
1620
- ) {
1592
+ fn add_to_diag < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
1621
1593
match self {
1622
1594
OverflowingBinHexSign :: Positive => {
1623
1595
diag. note ( fluent:: lint_positive_note) ;
0 commit comments