diff options
Diffstat (limited to 'tests/ui/threads-sendsync/issue-4448.rs')
-rw-r--r-- | tests/ui/threads-sendsync/issue-4448.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/threads-sendsync/issue-4448.rs b/tests/ui/threads-sendsync/issue-4448.rs new file mode 100644 index 000000000..27d032689 --- /dev/null +++ b/tests/ui/threads-sendsync/issue-4448.rs @@ -0,0 +1,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(); +} |