Skip to content

Commit 40b2218

Browse files
committed
Rename subdiagnostic fields that do not need to be unique now
1 parent eb7ce17 commit 40b2218

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

compiler/rustc_error_messages/locales/en-US/infer.ftl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,15 @@ infer_actual_impl_expl_expected_other_nothing = {$leading_ellipsis ->
233233
*[false] {""}
234234
}`{$ty_or_sig}` must implement `{$trait_path}`
235235
236-
infer_actual_impl_expl_but_actually_implements_trait = ...but it actually implements `{$trait_path_2}`{$has_lifetime ->
236+
infer_actual_impl_expl_but_actually_implements_trait = ...but it actually implements `{$trait_path}`{$has_lifetime ->
237237
[true] , for some specific lifetime `'{$lifetime}`
238238
*[false] {""}
239239
}
240-
infer_actual_impl_expl_but_actually_implemented_for_ty = ...but `{$trait_path_2}` is actually implemented for the type `{$ty}`{$has_lifetime ->
240+
infer_actual_impl_expl_but_actually_implemented_for_ty = ...but `{$trait_path}` is actually implemented for the type `{$ty}`{$has_lifetime ->
241241
[true] , for some specific lifetime `'{$lifetime}`
242242
*[false] {""}
243243
}
244-
infer_actual_impl_expl_but_actually_ty_implements = ...but `{$ty}` actually implements `{$trait_path_2}`{$has_lifetime ->
244+
infer_actual_impl_expl_but_actually_ty_implements = ...but `{$ty}` actually implements `{$trait_path}`{$has_lifetime ->
245245
[true] , for some specific lifetime `'{$lifetime}`
246246
*[false] {""}
247247
}

compiler/rustc_infer/src/errors/mod.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -617,21 +617,16 @@ pub enum ActualImplExplNotes {
617617
#[note(infer::actual_impl_expl_expected_other_nothing)]
618618
ExpectedOtherNothing { leading_ellipsis: bool, ty_or_sig: String, trait_path: String },
619619
#[note(infer::actual_impl_expl_but_actually_implements_trait)]
620-
ButActuallyImplementsTrait { trait_path_2: String, has_lifetime: bool, lifetime: usize },
620+
ButActuallyImplementsTrait { trait_path: String, has_lifetime: bool, lifetime: usize },
621621
#[note(infer::actual_impl_expl_but_actually_implemented_for_ty)]
622622
ButActuallyImplementedForTy {
623-
trait_path_2: String,
623+
trait_path: String,
624624
has_lifetime: bool,
625625
lifetime: usize,
626626
ty: String,
627627
},
628628
#[note(infer::actual_impl_expl_but_actually_ty_implements)]
629-
ButActuallyTyImplements {
630-
trait_path_2: String,
631-
has_lifetime: bool,
632-
lifetime: usize,
633-
ty: String,
634-
},
629+
ButActuallyTyImplements { trait_path: String, has_lifetime: bool, lifetime: usize, ty: String },
635630
}
636631

637632
pub enum ActualImplExpectedKind {

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/placeholder_error.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -474,27 +474,22 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
474474
None => true,
475475
};
476476

477-
let trait_path_2 = actual_trait_ref.map(|tr| tr.print_only_trait_path()).to_string();
477+
let trait_path = actual_trait_ref.map(|tr| tr.print_only_trait_path()).to_string();
478478
let ty = actual_trait_ref.map(|tr| tr.self_ty()).to_string();
479479
let has_lifetime = actual_has_vid.is_some();
480480
let lifetime = actual_has_vid.unwrap_or_default();
481481

482482
let note_2 = if same_self_type {
483-
ActualImplExplNotes::ButActuallyImplementsTrait { trait_path_2, has_lifetime, lifetime }
483+
ActualImplExplNotes::ButActuallyImplementsTrait { trait_path, has_lifetime, lifetime }
484484
} else if passive_voice {
485485
ActualImplExplNotes::ButActuallyImplementedForTy {
486-
trait_path_2,
486+
trait_path,
487487
ty,
488488
has_lifetime,
489489
lifetime,
490490
}
491491
} else {
492-
ActualImplExplNotes::ButActuallyTyImplements {
493-
trait_path_2,
494-
ty,
495-
has_lifetime,
496-
lifetime,
497-
}
492+
ActualImplExplNotes::ButActuallyTyImplements { trait_path, ty, has_lifetime, lifetime }
498493
};
499494

500495
vec![note_1, note_2]

0 commit comments

Comments
 (0)