rust/tests/ui/threads-sendsync/issue-4446.rs
2024-08-24 05:32:52 +02:00

19 lines
284 B
Rust

//@ run-pass
//@ needs-threads
use std::sync::mpsc::channel;
use std::thread;
pub fn main() {
let (tx, rx) = channel();
tx.send("hello, world").unwrap();
thread::spawn(move || {
println!("{}", rx.recv().unwrap());
})
.join()
.ok()
.unwrap();
}