From 071d0cd9f28d082e1cccd2c034b0e95d0b9c789b Mon Sep 17 00:00:00 2001 From: xonx <119700621+xonx4l@users.noreply.github.com> Date: Tue, 10 Feb 2026 18:37:36 +0000 Subject: [PATCH] rewording note and refer issue --- .../rustc_trait_selection/src/error_reporting/infer/mod.rs | 3 ++- .../associated-types/param-env-shadowing-issue-149910.stderr | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 {