summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types/issue-87429-associated-type-default.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generic-associated-types/issue-87429-associated-type-default.rs')
-rw-r--r--tests/ui/generic-associated-types/issue-87429-associated-type-default.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/generic-associated-types/issue-87429-associated-type-default.rs b/tests/ui/generic-associated-types/issue-87429-associated-type-default.rs
new file mode 100644
index 000000000..2006f9bc7
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-87429-associated-type-default.rs
@@ -0,0 +1,17 @@
+// check-fail
+
+#![feature(associated_type_defaults)]
+
+trait Family {
+ // Fine, i32: PartialEq<i32>
+ type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = i32;
+}
+
+struct Foo;
+trait Family2 {
+ // Not fine, not Foo: PartialEq<Foo>
+ type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo;
+ //~^ ERROR can't compare
+}
+
+fn main() {}