rust/src/test/run-pass/clone-with-exterior.rs
2018-12-25 21:08:33 -07:00

21 lines
322 B
Rust

#![allow(unused_must_use)]
// ignore-emscripten no threads support
#![feature(box_syntax)]
use std::thread;
struct Pair {
a: isize,
b: isize
}
pub fn main() {
let z: Box<_> = box Pair { a : 10, b : 12};
thread::spawn(move|| {
assert_eq!(z.a, 10);
assert_eq!(z.b, 12);
}).join();
}