| /* automatically generated by rust-bindgen */ |
| |
| #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] |
| |
| pub mod one_Foo { |
| pub type Type = i32; |
| pub const Variant1: Type = 0; |
| pub const Variant2: Type = 1; |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone)] |
| pub struct Bar { |
| pub baz1: one_Foo::Type, |
| pub baz2: *mut one_Foo::Type, |
| } |
| #[test] |
| fn bindgen_test_layout_Bar() { |
| assert_eq!( |
| ::std::mem::size_of::<Bar>(), |
| 16usize, |
| concat!("Size of: ", stringify!(Bar)) |
| ); |
| assert_eq!( |
| ::std::mem::align_of::<Bar>(), |
| 8usize, |
| concat!("Alignment of ", stringify!(Bar)) |
| ); |
| assert_eq!( |
| unsafe { &(*(::std::ptr::null::<Bar>())).baz1 as *const _ as usize }, |
| 0usize, |
| concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz1)) |
| ); |
| assert_eq!( |
| unsafe { &(*(::std::ptr::null::<Bar>())).baz2 as *const _ as usize }, |
| 8usize, |
| concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz2)) |
| ); |
| } |
| impl Default for Bar { |
| fn default() -> Self { |
| unsafe { ::std::mem::zeroed() } |
| } |
| } |