@@ -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 ( ) ;
@@ -808,11 +800,7 @@ pub(crate) struct HiddenUnicodeCodepointsDiagLabels {
808800}
809801
810802impl 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 > ) {
816804 for ( c, span) in self . spans {
817805 diag. span_label ( span, format ! ( "{c:?}" ) ) ;
818806 }
@@ -826,11 +814,7 @@ pub(crate) enum HiddenUnicodeCodepointsDiagSub {
826814
827815// Used because of multiple multipart_suggestion and note
828816impl 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 > ) {
834818 match self {
835819 HiddenUnicodeCodepointsDiagSub :: Escape { spans } => {
836820 diag. multipart_suggestion_with_style (
@@ -999,11 +983,7 @@ pub(crate) struct NonBindingLetSub {
999983}
1000984
1001985impl 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 > ) {
1007987 let can_suggest_binding = self . drop_fn_start_end . is_some ( ) || !self . is_assign_desugar ;
1008988
1009989 if can_suggest_binding {
@@ -1287,11 +1267,7 @@ pub(crate) enum NonSnakeCaseDiagSub {
12871267}
12881268
12891269impl 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 > ) {
12951271 match self {
12961272 NonSnakeCaseDiagSub :: Label { span } => {
12971273 diag. span_label ( span, fluent:: lint_label) ;
@@ -1613,11 +1589,7 @@ pub(crate) enum OverflowingBinHexSign {
16131589}
16141590
16151591impl 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 > ) {
16211593 match self {
16221594 OverflowingBinHexSign :: Positive => {
16231595 diag. note ( fluent:: lint_positive_note) ;
0 commit comments