summaryrefslogtreecommitdiffstats
path: root/tests/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs')
-rw-r--r--tests/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs b/tests/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs
new file mode 100644
index 000000000..039cf3e04
--- /dev/null
+++ b/tests/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs
@@ -0,0 +1,11 @@
+struct X<F> where F: FnOnce() + 'static + Send {
+ field: F,
+}
+
+fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static {
+ //~^ ERROR `F` cannot be sent between threads safely
+ return X { field: blk };
+}
+
+fn main() {
+}