Change:
*names.entry(item.name).or_insert(0) += 1; } let mut dupes = false; <ins> let mut shadows = false; </ins> for item in assoc_items { let prefix = if names[&item.name] > 1 { let trait_def_id = item.container_id(tcx); dupes = true; format!("{}::", tcx.def_path_str(trait_def_id)) <ins> } else if bound_names.get(&item.name).is_some_and(|x| x != &item) { let trait_def_id = item.container_id(tcx); shadows = true; format!("{}::", tcx.def_path_str(trait_def_id)) </ins> } else { String::new() }; <ins> let mut is_shadowed = false; if let Some(assoc_item) = bound_names.get(&item.name) && assoc_item != &item { is_shadowed = true; let rename_message = if assoc_item.def_id.is_local() { ", consider renaming it" } else { "" }; err.span_label( tcx.def_span(assoc_item.def_id), format!("`{}{}` shadowed here{}", prefix, item.name, rename_message), ); } let rename_message = if is_shadowed { ", consider renaming it" } else { "" }; </ins> if let Some(sp) = tcx.hir().span_if_local(item.def_id) { <del> err.span_label(sp, format!("`{}{}` defined here", prefix, item.name)); </del> <ins> err.span_label( sp, format!("`{}{}` defined here{}", prefix, item.name, rename_message), ); </ins> } } if potential_assoc_types.len() == assoc_items.len() {

Discussion:
Given the following code: The current output is: is wrong, specifying another isn't going to fix the problem. Writing just has a suggestion where`, which is good, but the concrete syntax would be nice. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
We probably should modify E0191 to hint that an supertrait's associated type is shadowed. I think E0719 here is fine to keep as-is, imo.
I agree the message for E0719 is good as-is.
Is this issue fixed ? If not can I take this up, please. Also how exactly should E0191 be modified. Imo, I don't think E0191 should pop up in this case as E0719 conveys the message.
claim
claim
Ask for help How do I specify the association type of supertrait with the same name? In other words, is there an easy way to modify the code in the issue to make it pass compilation? Here's my clumsy way of creating a new trait.
Is this issue still open? If so I would like to take a crack at it.
If you can still reproduce it, then yes indeed. assign
Error: Parsing assign command in failed: ...'zyDutchman' ''... Please file an issue on GitHub at if there's a problem with this bot, or reach out on on Zulip.
I have now a hint about the shadowing: But I am not quite sure about what to do about the actual message. Do we want to suggest renaming to something else Or do we want to suggest the work-around by
If the trait is local, then we could suggest renaming it. It's not required to be super specific here--we could just note the conflict to make the user aware of it, for example.
I have updated the help message so that this case: gives this error message: The rename help message is emitted for both the super trait and the subtrait, if they are local. I think I am ready to make a merge request, or does somebody have something else to add?
I recommend you to just open a PR. Any further discussions can happen over there :)