rust/tests/run-pass/packed_static.rs

11 lines
120 B
Rust
Raw Normal View History

2017-08-08 08:53:07 -05:00
#[repr(packed)]
struct Foo {
i: i32
}
fn main() {
assert_eq!({FOO.i}, 42);
}
static FOO: Foo = Foo { i: 42 };