summaryrefslogtreecommitdiffstats
path: root/src/test/ui/wf/wf-in-fn-ret.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/wf/wf-in-fn-ret.rs')
-rw-r--r--src/test/ui/wf/wf-in-fn-ret.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/wf/wf-in-fn-ret.rs b/src/test/ui/wf/wf-in-fn-ret.rs
new file mode 100644
index 000000000..4c9535184
--- /dev/null
+++ b/src/test/ui/wf/wf-in-fn-ret.rs
@@ -0,0 +1,14 @@
+// Check that we enforce WF conditions also for return types in fn items.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+struct MustBeCopy<T:Copy> {
+ t: T
+}
+
+fn bar<T>() -> MustBeCopy<T> //~ ERROR E0277
+{
+}
+
+fn main() { }