2 // ignore-emscripten no threads support
6 pub fn main() { test05(); }
8 fn test05_start<F:FnOnce(isize)>(f: F) {
13 let three: Box<_> = Box::new(3);
14 let fn_to_send = move|n:isize| {
15 println!("{}", *three + n); // will copy x into the closure
16 assert_eq!(*three, 3);
18 thread::spawn(move|| {
19 test05_start(fn_to_send);
20 }).join().ok().unwrap();