rewording note and refer issue

This commit is contained in:
xonx 2026-02-10 18:37:36 +00:00
parent c576dc55b8
commit 071d0cd9f2
2 changed files with 4 additions and 2 deletions

View file

@ -294,7 +294,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
if is_shadowed {
diag.note(format!(
"the associated type `{}` is defined as `{}` in the implementation, \
but the generic bound `{}` hides this definition",
but the where-bound `{}` shadows this definition\n\
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information",
self.ty_to_string(tcx.mk_ty_from_kind(ty::Alias(ty::Projection, *alias))),
self.ty_to_string(concrete),
self.ty_to_string(alias.self_ty())

View file

@ -10,7 +10,8 @@ LL | x
|
= note: expected associated type `<T as Trait>::Assoc`
found type parameter `T`
= note: the associated type `<T as Trait>::Assoc` is defined as `T` in the implementation, but the generic bound `T` hides this definition
= note: the associated type `<T as Trait>::Assoc` is defined as `T` in the implementation, but the where-bound `T` shadows this definition
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
help: consider further restricting this bound
|
LL | fn foo<T: Trait<Assoc = T>>(x: T) -> T::Assoc {