summaryrefslogtreecommitdiffstats
path: root/tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs')
-rw-r--r--tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs b/tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs
new file mode 100644
index 000000000..976054fac
--- /dev/null
+++ b/tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+// Another minimized regression test for #112832.
+trait Trait {
+ type Assoc;
+}
+
+trait Sub<'a>: Trait<Assoc = <Self as Sub<'a>>::SubAssoc> {
+ type SubAssoc;
+}
+
+// By using the where-clause we normalize `<T as Trait>::Assoc` to
+// `<T as Sub<'a>>::SubAssoc` where `'a` is an unconstrained region
+// variable.
+fn foo<T>(x: <T as Trait>::Assoc)
+where
+ for<'a> T: Sub<'a>,
+{}
+
+fn main() {}