blob: 07e6ae822860f90119d2c4fb7253fb5564795352 [file] [log] [blame]
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)] #[derive(Copy, Clone, Default)] pub struct foo { bar: ::std::os::raw::c_int, }
/**
* bar should compile. It will normally derive debug, but our blacklist of foo
* and replacement for another type that doesn't implement it would prevent it
* from building if --no-derive-debug didn't work.
*/
#[repr(C)]
#[derive(Default, Copy)]
pub struct bar {
pub foo: foo,
pub baz: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_bar() {
assert_eq!(::std::mem::size_of::<bar>() , 8usize , concat ! (
"Size of: " , stringify ! ( bar ) ));
assert_eq! (::std::mem::align_of::<bar>() , 4usize , concat ! (
"Alignment of " , stringify ! ( bar ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const bar ) ) . foo as * const _ as usize } ,
0usize , concat ! (
"Alignment of field: " , stringify ! ( bar ) , "::" ,
stringify ! ( foo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const bar ) ) . baz as * const _ as usize } ,
4usize , concat ! (
"Alignment of field: " , stringify ! ( bar ) , "::" ,
stringify ! ( baz ) ));
}
impl Clone for bar {
fn clone(&self) -> Self { *self }
}