2 // ignore-emscripten no threads support
4 #![feature(box_syntax)]
8 pub fn main() { test05(); }
10 fn test05_start<F:FnOnce(isize)>(f: F) {
15 let three: Box<_> = box 3;
16 let fn_to_send = move|n:isize| {
17 println!("{}", *three + n); // will copy x into the closure
18 assert_eq!(*three, 3);
20 thread::spawn(move|| {
21 test05_start(fn_to_send);
22 }).join().ok().unwrap();