summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/copy-requires-self-wf.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/traits/copy-requires-self-wf.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/traits/copy-requires-self-wf.rs b/tests/ui/traits/copy-requires-self-wf.rs
new file mode 100644
index 000000000..9abfdfab9
--- /dev/null
+++ b/tests/ui/traits/copy-requires-self-wf.rs
@@ -0,0 +1,14 @@
+// check-pass
+
+#[derive(Clone)]
+struct A<'a, T>(&'a T);
+
+impl<'a, T: Copy + 'a> Copy for A<'a, T> {}
+
+#[derive(Clone)]
+struct B<'a, T>(A<'a, T>);
+
+// `T: '_` should be implied by `WF(B<'_, T>)`.
+impl<T: Copy> Copy for B<'_, T> {}
+
+fn main() {}