summaryrefslogtreecommitdiffstats
path: root/src/test/ui/threads-sendsync/clone-with-exterior.rs
blob: 9fc661b14777ea6eb4708a37d7d1b05e6ccacf29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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();
}