rust/tests/ui/threads-sendsync/clone-with-exterior.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
316 B
Rust
Raw Normal View History

// run-pass
#![allow(unused_must_use)]
// ignore-emscripten no threads support
use std::thread;
struct Pair {
a: isize,
b: isize
2011-07-27 12:48:34 +00:00
}
pub fn main() {
let z: Box<_> = Box::new(Pair { a : 10, b : 12});
2015-04-13 22:15:32 +00:00
thread::spawn(move|| {
assert_eq!(z.a, 10);
assert_eq!(z.b, 12);
2015-04-13 22:15:32 +00:00
}).join();
}