mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-16 19:57:10 +00:00
16 lines
221 B
Rust
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();
|
|
}
|