diff --git a/tests/ui/associated-types/param-env-shadowing-false-positive.rs b/tests/ui/associated-types/param-env-shadowing-false-positive.rs index e40d36dabc81..41993f5cba19 100644 --- a/tests/ui/associated-types/param-env-shadowing-false-positive.rs +++ b/tests/ui/associated-types/param-env-shadowing-false-positive.rs @@ -1,3 +1,7 @@ +// Regression test for issue #149910. +// The compiler previously incorrectly claimed that the local param-env bound +// shadowed the global impl, but they are actually the same. + trait Trait { type Assoc; } diff --git a/tests/ui/associated-types/param-env-shadowing-false-positive.stderr b/tests/ui/associated-types/param-env-shadowing-false-positive.stderr index f4a687196ca1..64d7950f41ef 100644 --- a/tests/ui/associated-types/param-env-shadowing-false-positive.stderr +++ b/tests/ui/associated-types/param-env-shadowing-false-positive.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/param-env-shadowing-false-positive.rs:10:5 + --> $DIR/param-env-shadowing-false-positive.rs:14:5 | LL | fn foo(x: T::Assoc) -> u32 { | --- expected `u32` because of return type diff --git a/tests/ui/associated-types/param-env-shadowing-gat.rs b/tests/ui/associated-types/param-env-shadowing-gat.rs index c7c559eb83b2..9dc91a1a1465 100644 --- a/tests/ui/associated-types/param-env-shadowing-gat.rs +++ b/tests/ui/associated-types/param-env-shadowing-gat.rs @@ -1,3 +1,7 @@ +// Regression test for issue #149910. +// This ensures that the diagnostics logic handles Generic Associated Types (GATs) +// correctly without crashing (ICE). + trait Trait { type Assoc; } diff --git a/tests/ui/associated-types/param-env-shadowing-gat.stderr b/tests/ui/associated-types/param-env-shadowing-gat.stderr index ed6e92c64ae0..02c024341724 100644 --- a/tests/ui/associated-types/param-env-shadowing-gat.stderr +++ b/tests/ui/associated-types/param-env-shadowing-gat.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/param-env-shadowing-gat.rs:10:5 + --> $DIR/param-env-shadowing-gat.rs:14:5 | LL | fn foo(x: T::Assoc) -> u32 { | --- expected `u32` because of return type