]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/pass/mpsc.rs
Merge commit '4bdfb0741dbcecd5279a2635c3280726db0604b5' into clippyup
[rust.git] / src / tools / miri / tests / pass / mpsc.rs
1 #![feature(box_syntax)]
2
3 use std::sync::mpsc::channel;
4
5 pub fn main() {
6     let (tx, rx) = channel::<Box<_>>();
7     tx.send(box 100).unwrap();
8     let v = rx.recv().unwrap();
9     assert_eq!(v, box 100);
10
11     tx.send(box 101).unwrap();
12     tx.send(box 102).unwrap();
13     assert_eq!(rx.recv().unwrap(), box 101);
14     assert_eq!(rx.recv().unwrap(), box 102);
15 }