1
Fork 0

More descriptive names for ActualImplExplNotes variants

This commit is contained in:
Nikita Tomashevich 2022-09-25 10:55:42 +03:00
parent 57fdd196ae
commit 6c19c08140
No known key found for this signature in database
GPG key ID: B29791D4D878E345
3 changed files with 8 additions and 8 deletions

View file

@ -184,7 +184,7 @@ infer_explicit_lifetime_required_sugg = add explicit lifetime `{$named}` to {$id
*[param_type] type *[param_type] type
} }
infer_actual_impl_expl_1 = {$leading_ellipsis -> infer_actual_impl_expl_expected = {$leading_ellipsis ->
[true] ... [true] ...
*[false] {""} *[false] {""}
}{$kind -> }{$kind ->
@ -198,7 +198,7 @@ infer_actual_impl_expl_1 = {$leading_ellipsis ->
*[nothing] {""} *[nothing] {""}
} }
infer_actual_impl_expl_2 = {$kind_2 -> infer_actual_impl_expl_but_actually = {$kind_2 ->
[implements_trait] ...but it actually implements `{$trait_path_2}` [implements_trait] ...but it actually implements `{$trait_path_2}`
[implemented_for_ty] ...but `{$trait_path_2}` is actually implemented for the type `{$ty}` [implemented_for_ty] ...but `{$trait_path_2}` is actually implemented for the type `{$ty}`
*[ty_implements] ...but `{$ty}` actually implements `{$trait_path_2}` *[ty_implements] ...but `{$ty}` actually implements `{$trait_path_2}`

View file

@ -545,8 +545,8 @@ pub struct ExplicitLifetimeRequired<'a> {
#[derive(Subdiagnostic)] #[derive(Subdiagnostic)]
pub enum ActualImplExplNotes { pub enum ActualImplExplNotes {
// Field names have to be different across all variants // Field names have to be different across all variants
#[note(infer::actual_impl_expl_1)] #[note(infer::actual_impl_expl_expected)]
NoteOne { Expected {
leading_ellipsis: bool, leading_ellipsis: bool,
kind: &'static str, kind: &'static str,
ty_or_sig: String, ty_or_sig: String,
@ -555,8 +555,8 @@ pub enum ActualImplExplNotes {
lifetime_1: usize, lifetime_1: usize,
lifetime_2: usize, lifetime_2: usize,
}, },
#[note(infer::actual_impl_expl_2)] #[note(infer::actual_impl_expl_but_actually)]
NoteTwo { ButActually {
kind_2: &'static str, kind_2: &'static str,
trait_path_2: String, trait_path_2: String,
has_lifetime: bool, has_lifetime: bool,

View file

@ -451,7 +451,7 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
} }
}; };
let note_1 = ActualImplExplNotes::NoteOne { let note_1 = ActualImplExplNotes::Expected {
leading_ellipsis, leading_ellipsis,
kind, kind,
ty_or_sig, ty_or_sig,
@ -483,7 +483,7 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
let lifetime = actual_has_vid.unwrap_or_default(); let lifetime = actual_has_vid.unwrap_or_default();
let note_2 = let note_2 =
ActualImplExplNotes::NoteTwo { kind_2, trait_path_2, ty, has_lifetime, lifetime }; ActualImplExplNotes::ButActually { kind_2, trait_path_2, ty, has_lifetime, lifetime };
vec![note_1, note_2] vec![note_1, note_2]
} }