mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
21 lines
316 B
Rust
21 lines
316 B
Rust
// run-pass
|
|
|
|
#![allow(unused_must_use)]
|
|
// ignore-emscripten no threads support
|
|
|
|
use std::thread;
|
|
|
|
struct Pair {
|
|
a: isize,
|
|
b: isize
|
|
}
|
|
|
|
pub fn main() {
|
|
let z: Box<_> = Box::new(Pair { a : 10, b : 12});
|
|
|
|
thread::spawn(move|| {
|
|
assert_eq!(z.a, 10);
|
|
assert_eq!(z.b, 12);
|
|
}).join();
|
|
}
|