about summary refs log tree commit diff
path: root/src/tools/miri/tests/pass/mpsc.rs
blob: 3824a0de907cfee22d9ddeb0712a8e79f78487a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::sync::mpsc::channel;

pub fn main() {
    let (tx, rx) = channel::<Box<_>>();
    tx.send(Box::new(100)).unwrap();
    let v = rx.recv().unwrap();
    assert_eq!(v, Box::new(100));

    tx.send(Box::new(101)).unwrap();
    tx.send(Box::new(102)).unwrap();
    assert_eq!(rx.recv().unwrap(), Box::new(101));
    assert_eq!(rx.recv().unwrap(), Box::new(102));
}