diff options
Diffstat (limited to 'tests/expectations/struct_with_nesting.rs')
-rw-r--r-- | tests/expectations/struct_with_nesting.rs | 91 |
1 files changed, 36 insertions, 55 deletions
diff --git a/tests/expectations/struct_with_nesting.rs b/tests/expectations/struct_with_nesting.rs index 2de481ea..ca5ec09e 100644 --- a/tests/expectations/struct_with_nesting.rs +++ b/tests/expectations/struct_with_nesting.rs @@ -4,7 +4,7 @@ #![allow(non_snake_case)] -#[derive(Copy, Debug)] +#[derive(Debug)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); impl <T> __BindgenUnionField<T> { @@ -23,89 +23,70 @@ impl <T> ::std::clone::Clone for __BindgenUnionField<T> { #[inline] fn clone(&self) -> Self { Self::new() } } +impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_foo { +pub struct foo { pub a: ::std::os::raw::c_uint, - pub foo_struct_with_nesting_h_unnamed_1: Union_foo_struct_with_nesting_h_unnamed_1, + pub __bindgen_anon_1: foo__bindgen_ty_bindgen_id_3, } #[repr(C)] #[derive(Debug, Copy)] -pub struct Union_foo_struct_with_nesting_h_unnamed_1 { +pub struct foo__bindgen_ty_bindgen_id_3 { pub b: __BindgenUnionField<::std::os::raw::c_uint>, - pub foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_2: __BindgenUnionField<Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_2>, - pub foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_3: __BindgenUnionField<Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_3>, - pub _bindgen_data_: u32, -} -impl Union_foo_struct_with_nesting_h_unnamed_1 { - pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_uint { - let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); - ::std::mem::transmute(raw.offset(0)) - } - pub unsafe fn foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_2(&mut self) - -> - *mut Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_2 { - let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); - ::std::mem::transmute(raw.offset(0)) - } - pub unsafe fn foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_3(&mut self) - -> - *mut Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_3 { - let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); - ::std::mem::transmute(raw.offset(0)) - } -} -impl ::std::clone::Clone for Union_foo_struct_with_nesting_h_unnamed_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_Union_foo_struct_with_nesting_h_unnamed_1() { - assert_eq!(::std::mem::size_of::<Union_foo_struct_with_nesting_h_unnamed_1>() - , 4usize); - assert_eq!(::std::mem::align_of::<Union_foo_struct_with_nesting_h_unnamed_1>() - , 4usize); + pub __bindgen_anon_1: __BindgenUnionField<foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_5>, + pub __bindgen_anon_2: __BindgenUnionField<foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_8>, + pub bindgen_union_field: u32, } #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_2 { +pub struct foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_5 { pub c1: ::std::os::raw::c_ushort, pub c2: ::std::os::raw::c_ushort, } -impl ::std::clone::Clone for - Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_2 { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_2() { - assert_eq!(::std::mem::size_of::<Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_2>() +fn bindgen_test_layout_foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_5() { + assert_eq!(::std::mem::size_of::<foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_5>() , 4usize); - assert_eq!(::std::mem::align_of::<Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_2>() + assert_eq!(::std::mem::align_of::<foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_5>() , 2usize); } +impl Clone for foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_5 { + fn clone(&self) -> Self { *self } +} #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_3 { +pub struct foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_8 { pub d1: ::std::os::raw::c_uchar, pub d2: ::std::os::raw::c_uchar, pub d3: ::std::os::raw::c_uchar, pub d4: ::std::os::raw::c_uchar, } -impl ::std::clone::Clone for - Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_3 { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_3() { - assert_eq!(::std::mem::size_of::<Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_3>() +fn bindgen_test_layout_foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_8() { + assert_eq!(::std::mem::size_of::<foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_8>() , 4usize); - assert_eq!(::std::mem::align_of::<Struct_foo_struct_with_nesting_h_unnamed_1_struct_with_nesting_h_unnamed_3>() + assert_eq!(::std::mem::align_of::<foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_8>() , 1usize); } -impl ::std::clone::Clone for Struct_foo { +impl Clone for foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_8 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_Struct_foo() { - assert_eq!(::std::mem::size_of::<Struct_foo>() , 8usize); - assert_eq!(::std::mem::align_of::<Struct_foo>() , 4usize); +fn bindgen_test_layout_foo__bindgen_ty_bindgen_id_3() { + assert_eq!(::std::mem::size_of::<foo__bindgen_ty_bindgen_id_3>() , + 4usize); + assert_eq!(::std::mem::align_of::<foo__bindgen_ty_bindgen_id_3>() , + 4usize); +} +impl Clone for foo__bindgen_ty_bindgen_id_3 { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_foo() { + assert_eq!(::std::mem::size_of::<foo>() , 8usize); + assert_eq!(::std::mem::align_of::<foo>() , 4usize); +} +impl Clone for foo { + fn clone(&self) -> Self { *self } } |