summary refs log tree commit diff
path: root/tests/ui/threads-sendsync/issue-4446.rs
blob: aa2de51974b37415a9ab38c25a8900eb8324e852 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ 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();
}