diff --git a/tests/ui/associated-types/associated-types-match-despite-generic.rs b/tests/ui/associated-types/associated-types-match-despite-generic.rs new file mode 100644 index 0000000000000..04fc374e59a0c --- /dev/null +++ b/tests/ui/associated-types/associated-types-match-despite-generic.rs @@ -0,0 +1,21 @@ +//! Regression test for . +//@compile-flags: -Znext-solver=globally +//@ check-pass + +struct Outer; +struct Inner; +trait Id { + type This; +} +impl Id for T { + type This = T; +} + +fn free(x: T) -> >::This +where + >::This: Id>::This>, +{ + x +} + +fn main() {}