summaryrefslogtreecommitdiffstats
path: root/tests/ui/threads-sendsync/issue-4448.rs
blob: 27d0326891b50b91bb488c27148e66dbad8f261d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-pass
// ignore-emscripten no threads support

use std::sync::mpsc::channel;
use std::thread;

pub fn main() {
    let (tx, rx) = channel::<&'static str>();

    let t = thread::spawn(move|| {
        assert_eq!(rx.recv().unwrap(), "hello, world");
    });

    tx.send("hello, world").unwrap();
    t.join().ok().unwrap();
}