mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
19 lines
276 B
Rust
19 lines
276 B
Rust
//@ 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());
|
|
}
|