mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
16 lines
287 B
Rust
16 lines
287 B
Rust
// run-pass
|
|
use std::mem;
|
|
|
|
#[r#repr(r#C, r#packed)]
|
|
struct Test {
|
|
a: bool, b: u64
|
|
}
|
|
|
|
#[r#derive(r#Debug)]
|
|
struct Test2(#[allow(unused_tuple_struct_fields)] u32);
|
|
|
|
pub fn main() {
|
|
assert_eq!(mem::size_of::<Test>(), 9);
|
|
assert_eq!("Test2(123)", format!("{:?}", Test2(123)));
|
|
}
|