summaryrefslogtreecommitdiffstats
path: root/src/test/ui/functions-closures/closure-bounds-can-capture-chan.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/functions-closures/closure-bounds-can-capture-chan.rs')
-rw-r--r--src/test/ui/functions-closures/closure-bounds-can-capture-chan.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/functions-closures/closure-bounds-can-capture-chan.rs b/src/test/ui/functions-closures/closure-bounds-can-capture-chan.rs
new file mode 100644
index 000000000..ccb2e201d
--- /dev/null
+++ b/src/test/ui/functions-closures/closure-bounds-can-capture-chan.rs
@@ -0,0 +1,16 @@
+// run-pass
+// pretty-expanded FIXME #23616
+
+use std::sync::mpsc::channel;
+
+fn foo<F:FnOnce()+Send>(blk: F) {
+ blk();
+}
+
+pub fn main() {
+ let (tx, rx) = channel();
+ foo(move || {
+ tx.send(()).unwrap();
+ });
+ rx.recv().unwrap();
+}