summaryrefslogtreecommitdiffstats
path: root/src/test/ui/wf/wf-in-obj-type-static.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/wf/wf-in-obj-type-static.rs')
-rw-r--r--src/test/ui/wf/wf-in-obj-type-static.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/wf/wf-in-obj-type-static.rs b/src/test/ui/wf/wf-in-obj-type-static.rs
new file mode 100644
index 000000000..1ad2fd1ed
--- /dev/null
+++ b/src/test/ui/wf/wf-in-obj-type-static.rs
@@ -0,0 +1,18 @@
+// Check that we enforce WF conditions also for types in fns.
+
+
+#![allow(dead_code)]
+
+trait Object<T> { }
+
+struct MustBeCopy<T:Copy> {
+ t: T
+}
+
+struct Foo<T> {
+ // needs T: 'static
+ x: dyn Object<&'static T> //~ ERROR E0310
+}
+
+
+fn main() { }