diff options
Diffstat (limited to 'tests/expectations/union_with_anon_unnamed_struct.rs')
-rw-r--r-- | tests/expectations/union_with_anon_unnamed_struct.rs | 51 |
1 files changed, 20 insertions, 31 deletions
diff --git a/tests/expectations/union_with_anon_unnamed_struct.rs b/tests/expectations/union_with_anon_unnamed_struct.rs index cdc760c4..80b3e97a 100644 --- a/tests/expectations/union_with_anon_unnamed_struct.rs +++ b/tests/expectations/union_with_anon_unnamed_struct.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,48 +23,37 @@ 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 Union_pixel { +pub struct pixel { pub rgba: __BindgenUnionField<::std::os::raw::c_uint>, - pub pixel_union_with_anon_unnamed_struct_h_unnamed_1: __BindgenUnionField<Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_1>, - pub _bindgen_data_: u32, -} -impl Union_pixel { - pub unsafe fn rgba(&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 pixel_union_with_anon_unnamed_struct_h_unnamed_1(&mut self) - -> *mut Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_1 { - let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); - ::std::mem::transmute(raw.offset(0)) - } -} -impl ::std::clone::Clone for Union_pixel { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_Union_pixel() { - assert_eq!(::std::mem::size_of::<Union_pixel>() , 4usize); - assert_eq!(::std::mem::align_of::<Union_pixel>() , 4usize); + pub __bindgen_anon_1: __BindgenUnionField<pixel__bindgen_ty_bindgen_id_3>, + pub bindgen_union_field: u32, } #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_1 { +pub struct pixel__bindgen_ty_bindgen_id_3 { pub r: ::std::os::raw::c_uchar, pub g: ::std::os::raw::c_uchar, pub b: ::std::os::raw::c_uchar, pub a: ::std::os::raw::c_uchar, } -impl ::std::clone::Clone for - Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_1 { +#[test] +fn bindgen_test_layout_pixel__bindgen_ty_bindgen_id_3() { + assert_eq!(::std::mem::size_of::<pixel__bindgen_ty_bindgen_id_3>() , + 4usize); + assert_eq!(::std::mem::align_of::<pixel__bindgen_ty_bindgen_id_3>() , + 1usize); +} +impl Clone for pixel__bindgen_ty_bindgen_id_3 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_1() { - assert_eq!(::std::mem::size_of::<Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_1>() - , 4usize); - assert_eq!(::std::mem::align_of::<Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_1>() - , 1usize); +fn bindgen_test_layout_pixel() { + assert_eq!(::std::mem::size_of::<pixel>() , 4usize); + assert_eq!(::std::mem::align_of::<pixel>() , 4usize); +} +impl Clone for pixel { + fn clone(&self) -> Self { *self } } |