rustc/tests/ui/functions-closures/closure-bounds-can-capture-chan.rs
2025-02-17 11:14:05 +01:00

16 lines
221 B
Rust

//@ run-pass
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();
}