1
Fork 0

Tweak wording

This commit is contained in:
Esteban Küber 2023-09-29 16:17:22 +00:00
parent 781e86477c
commit 20c622e456
4 changed files with 6 additions and 5 deletions

View file

@ -191,10 +191,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
.collect::<Vec<_>>()[..]
{
let trait_name = self.tcx().def_path_str(*best_trait);
let an = if suggested_name != assoc_name.name { "a similarly named" } else { "an" };
err.span_label(
assoc_name.span,
format!(
"there is a similarly named associated type `{suggested_name}` in the \
"there is {an} associated type `{suggested_name}` in the \
trait `{trait_name}`",
),
);