2019-07-26 21:54:25 +00:00
|
|
|
// run-pass
|
|
|
|
|
2018-09-14 10:20:28 +00:00
|
|
|
#![allow(unused_must_use)]
|
2016-02-11 11:34:41 +00:00
|
|
|
// ignore-emscripten no threads support
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2015-03-30 18:00:05 +00:00
|
|
|
use std::thread;
|
2011-08-13 22:20:11 +00:00
|
|
|
|
2013-04-28 18:50:04 +00:00
|
|
|
struct Pair {
|
2015-03-26 00:06:52 +00:00
|
|
|
a: isize,
|
|
|
|
b: isize
|
2011-07-27 12:48:34 +00:00
|
|
|
}
|
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2021-08-25 00:39:40 +00:00
|
|
|
let z: Box<_> = Box::new(Pair { a : 10, b : 12});
|
2013-05-03 23:25:04 +00:00
|
|
|
|
2015-04-13 22:15:32 +00:00
|
|
|
thread::spawn(move|| {
|
2013-05-19 02:02:45 +00:00
|
|
|
assert_eq!(z.a, 10);
|
|
|
|
assert_eq!(z.b, 12);
|
2015-04-13 22:15:32 +00:00
|
|
|
}).join();
|
2013-02-14 19:47:00 +00:00
|
|
|
}
|