summaryrefslogtreecommitdiffstats
path: root/src/test/ui/wf/wf-in-fn-type-arg.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/wf/wf-in-fn-type-arg.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/wf/wf-in-fn-type-arg.rs b/src/test/ui/wf/wf-in-fn-type-arg.rs
new file mode 100644
index 000000000..2917a8aa9
--- /dev/null
+++ b/src/test/ui/wf/wf-in-fn-type-arg.rs
@@ -0,0 +1,12 @@
+// Check that we enforce WF conditions also for types in fns.
+
+struct MustBeCopy<T:Copy> {
+ t: T
+}
+
+struct Bar<T> {
+ // needs T: Copy
+ x: fn(MustBeCopy<T>) //~ ERROR E0277
+}
+
+fn main() { }