diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs index 7a14901b32d9..5597fe488c1a 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs @@ -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 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()) diff --git a/tests/ui/associated-types/param-env-shadowing-issue-149910.stderr b/tests/ui/associated-types/param-env-shadowing-issue-149910.stderr index fb05f0add349..b06770e52635 100644 --- a/tests/ui/associated-types/param-env-shadowing-issue-149910.stderr +++ b/tests/ui/associated-types/param-env-shadowing-issue-149910.stderr @@ -10,7 +10,8 @@ LL | x | = note: expected associated type `::Assoc` found type parameter `T` - = note: the associated type `::Assoc` is defined as `T` in the implementation, but the generic bound `T` hides this definition + = note: the associated type `::Assoc` is defined as `T` in the implementation, but the where-bound `T` shadows this definition + see issue #152409 for more information help: consider further restricting this bound | LL | fn foo>(x: T) -> T::Assoc {