about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/dyn-compatibility/associated_type_bound_mentions_self.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/dyn-compatibility/associated_type_bound_mentions_self.rs b/tests/ui/dyn-compatibility/associated_type_bound_mentions_self.rs
new file mode 100644
index 00000000000..0be5fa27b4c
--- /dev/null
+++ b/tests/ui/dyn-compatibility/associated_type_bound_mentions_self.rs
@@ -0,0 +1,14 @@
+// Ensure that we properly ignore the `B<Self>` associated type bound on `A::T`
+// since that associated type requires `Self: Sized`.
+
+//@ check-pass
+
+struct X(&'static dyn A);
+
+trait A {
+    type T: B<Self> where Self: Sized;
+}
+
+trait B<T> {}
+
+fn main() {}