diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs b/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs new file mode 100644 index 000000000..039cf3e04 --- /dev/null +++ b/src/test/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() { +} |