summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs')
-rw-r--r--tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs b/tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs
new file mode 100644
index 000000000..e2d51c664
--- /dev/null
+++ b/tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs
@@ -0,0 +1,18 @@
+// known-bug: #117606
+
+#![feature(associated_type_defaults)]
+
+trait Foo {
+ type Bar<T>: Baz<Self> = i32;
+ // We should be able to prove that `i32: Baz<Self>` because of
+ // the impl below, which requires that `Self::Bar<()>: Eq<i32>`
+ // which is true, because we assume `for<T> Self::Bar<T> = i32`.
+}
+
+trait Baz<T: ?Sized> {}
+impl<T: Foo + ?Sized> Baz<T> for i32 where T::Bar<()>: Eq<i32> {}
+
+trait Eq<T> {}
+impl<T> Eq<T> for T {}
+
+fn main() {}