about summary refs log tree commit diff
path: root/tests/ui/impl-trait/projection-mismatch-in-impl-where-clause.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/projection-mismatch-in-impl-where-clause.rs')
-rw-r--r--tests/ui/impl-trait/projection-mismatch-in-impl-where-clause.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/projection-mismatch-in-impl-where-clause.rs b/tests/ui/impl-trait/projection-mismatch-in-impl-where-clause.rs
new file mode 100644
index 00000000000..b4fd6b3e743
--- /dev/null
+++ b/tests/ui/impl-trait/projection-mismatch-in-impl-where-clause.rs
@@ -0,0 +1,20 @@
+pub trait Super {
+    type Assoc;
+}
+
+impl Super for () {
+    type Assoc = u8;
+}
+
+pub trait Test {}
+
+impl<T> Test for T where T: Super<Assoc = ()> {}
+
+fn test() -> impl Test {
+    //~^ERROR type mismatch resolving `<() as Super>::Assoc == ()`
+    ()
+}
+
+fn main() {
+    let a = test();
+}