2 #![allow(unused_must_use)]
3 // ignore-emscripten no threads support
6 use std::sync::mpsc::channel;
9 let (tx, rx) = channel::<usize>();
11 let x: Box<isize> = Box::new(1);
12 let x_in_parent = &(*x) as *const isize as usize;
14 let t = thread::spawn(move || {
15 let x_in_child = &(*x) as *const isize as usize;
16 tx.send(x_in_child).unwrap();
19 let x_in_child = rx.recv().unwrap();
20 assert_eq!(x_in_parent, x_in_child);