@@ -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 (
@@ -994,11 +978,7 @@ pub(crate) struct NonBindingLetSub {
994978}
995979
996980impl 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 > ) {
1002982 let can_suggest_binding = self . drop_fn_start_end . is_some ( ) || !self . is_assign_desugar ;
1003983
1004984 if can_suggest_binding {
@@ -1282,11 +1262,7 @@ pub(crate) enum NonSnakeCaseDiagSub {
12821262}
12831263
12841264impl 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 > ) {
12901266 match self {
12911267 NonSnakeCaseDiagSub :: Label { span } => {
12921268 diag. span_label ( span, fluent:: lint_label) ;
@@ -1608,11 +1584,7 @@ pub(crate) enum OverflowingBinHexSign {
16081584}
16091585
16101586impl 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 > ) {
16161588 match self {
16171589 OverflowingBinHexSign :: Positive => {
16181590 diag. note ( fluent:: lint_positive_note) ;
0 commit comments