about summary refs log tree commit diff
path: root/tests/ui/parallel-rustc/read-stolen-value-issue-111520.rs
blob: ea8ecb678591a49e2ca85fbad0d6da2b433de653 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ compile-flags: -Z threads=16
//@ run-pass

#[repr(transparent)]
struct Sched {
    i: i32,
}
impl Sched {
    extern "C" fn get(self) -> i32 { self.i }
}

fn main() {
    let s = Sched { i: 4 };
    let f = || -> i32 {
        s.get()
    };
    println!("f: {}", f());
}