@@ -6,7 +6,7 @@ use rustc_abi::ExternAbi;
66use rustc_errors:: codes:: * ;
77use rustc_errors:: {
88 Applicability , Diag , DiagArgValue , DiagMessage , DiagStyledString , ElidedLifetimeInPathSubdiag ,
9- EmissionGuarantee , LintDiagnostic , MultiSpan , SubdiagMessageOp , Subdiagnostic , SuggestionStyle ,
9+ EmissionGuarantee , LintDiagnostic , MultiSpan , Subdiagnostic , SuggestionStyle ,
1010} ;
1111use rustc_hir:: def:: Namespace ;
1212use rustc_hir:: def_id:: DefId ;
@@ -449,11 +449,7 @@ pub(crate) struct BuiltinUnpermittedTypeInitSub {
449449}
450450
451451impl 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 > ) {
457453 let mut err = self . err ;
458454 loop {
459455 if let Some ( span) = err. span {
@@ -504,11 +500,7 @@ pub(crate) struct BuiltinClashingExternSub<'a> {
504500}
505501
506502impl 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 > ) {
512504 let mut expected_str = DiagStyledString :: new ( ) ;
513505 expected_str. push ( self . expected . fn_sig ( self . tcx ) . to_string ( ) , false ) ;
514506 let mut found_str = DiagStyledString :: new ( ) ;
@@ -824,11 +816,7 @@ pub(crate) struct HiddenUnicodeCodepointsDiagLabels {
824816}
825817
826818impl 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 > ) {
832820 for ( c, span) in self . spans {
833821 diag. span_label ( span, format ! ( "{c:?}" ) ) ;
834822 }
@@ -842,11 +830,7 @@ pub(crate) enum HiddenUnicodeCodepointsDiagSub {
842830
843831// Used because of multiple multipart_suggestion and note
844832impl 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 > ) {
850834 match self {
851835 HiddenUnicodeCodepointsDiagSub :: Escape { spans } => {
852836 diag. multipart_suggestion_with_style (
@@ -1015,11 +999,7 @@ pub(crate) struct NonBindingLetSub {
1015999}
10161000
10171001impl 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 > ) {
10231003 let can_suggest_binding = self . drop_fn_start_end . is_some ( ) || !self . is_assign_desugar ;
10241004
10251005 if can_suggest_binding {
@@ -1303,11 +1283,7 @@ pub(crate) enum NonSnakeCaseDiagSub {
13031283}
13041284
13051285impl 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 > ) {
13111287 match self {
13121288 NonSnakeCaseDiagSub :: Label { span } => {
13131289 diag. span_label ( span, fluent:: lint_label) ;
@@ -1629,11 +1605,7 @@ pub(crate) enum OverflowingBinHexSign {
16291605}
16301606
16311607impl 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 > ) {
16371609 match self {
16381610 OverflowingBinHexSign :: Positive => {
16391611 diag. note ( fluent:: lint_positive_note) ;
0 commit comments