|
| 1 | +/* automatically generated by rust-bindgen */ |
| 2 | + |
| 3 | + |
| 4 | +#![allow(non_snake_case)] |
| 5 | + |
| 6 | + |
| 7 | +#[repr(C)] |
| 8 | +pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); |
| 9 | +impl <T> __BindgenUnionField<T> { |
| 10 | + #[inline] |
| 11 | + pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } |
| 12 | + #[inline] |
| 13 | + pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } |
| 14 | + #[inline] |
| 15 | + pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } |
| 16 | +} |
| 17 | +impl <T> ::std::default::Default for __BindgenUnionField<T> { |
| 18 | + #[inline] |
| 19 | + fn default() -> Self { Self::new() } |
| 20 | +} |
| 21 | +impl <T> ::std::clone::Clone for __BindgenUnionField<T> { |
| 22 | + #[inline] |
| 23 | + fn clone(&self) -> Self { Self::new() } |
| 24 | +} |
| 25 | +impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } |
| 26 | +impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { |
| 27 | + fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { |
| 28 | + fmt.write_str("__BindgenUnionField") |
| 29 | + } |
| 30 | +} |
| 31 | +#[repr(C)] |
| 32 | +#[derive(Debug, Default, Copy)] |
| 33 | +pub struct s { |
| 34 | + pub u: s__bindgen_ty_1, |
| 35 | +} |
| 36 | +#[repr(C)] |
| 37 | +#[derive(Debug, Default, Copy)] |
| 38 | +pub struct s__bindgen_ty_1 { |
| 39 | + pub field: __BindgenUnionField<s__bindgen_ty_1_inner>, |
| 40 | + pub bindgen_union_field: u32, |
| 41 | +} |
| 42 | +#[repr(C)] |
| 43 | +#[derive(Debug, Default, Copy)] |
| 44 | +pub struct s__bindgen_ty_1_inner { |
| 45 | + pub b: ::std::os::raw::c_int, |
| 46 | +} |
| 47 | +#[test] |
| 48 | +fn bindgen_test_layout_s__bindgen_ty_1_inner() { |
| 49 | + assert_eq!(::std::mem::size_of::<s__bindgen_ty_1_inner>() , 4usize , |
| 50 | + concat ! ( "Size of: " , stringify ! ( s__bindgen_ty_1_inner ) |
| 51 | + )); |
| 52 | + assert_eq! (::std::mem::align_of::<s__bindgen_ty_1_inner>() , 4usize , |
| 53 | + concat ! ( |
| 54 | + "Alignment of " , stringify ! ( s__bindgen_ty_1_inner ) )); |
| 55 | + assert_eq! (unsafe { |
| 56 | + & ( * ( 0 as * const s__bindgen_ty_1_inner ) ) . b as * const |
| 57 | + _ as usize } , 0usize , concat ! ( |
| 58 | + "Alignment of field: " , stringify ! ( s__bindgen_ty_1_inner ) |
| 59 | + , "::" , stringify ! ( b ) )); |
| 60 | +} |
| 61 | +impl Clone for s__bindgen_ty_1_inner { |
| 62 | + fn clone(&self) -> Self { *self } |
| 63 | +} |
| 64 | +#[test] |
| 65 | +fn bindgen_test_layout_s__bindgen_ty_1() { |
| 66 | + assert_eq!(::std::mem::size_of::<s__bindgen_ty_1>() , 4usize , concat ! ( |
| 67 | + "Size of: " , stringify ! ( s__bindgen_ty_1 ) )); |
| 68 | + assert_eq! (::std::mem::align_of::<s__bindgen_ty_1>() , 4usize , concat ! |
| 69 | + ( "Alignment of " , stringify ! ( s__bindgen_ty_1 ) )); |
| 70 | + assert_eq! (unsafe { |
| 71 | + & ( * ( 0 as * const s__bindgen_ty_1 ) ) . field as * const _ |
| 72 | + as usize } , 0usize , concat ! ( |
| 73 | + "Alignment of field: " , stringify ! ( s__bindgen_ty_1 ) , |
| 74 | + "::" , stringify ! ( field ) )); |
| 75 | +} |
| 76 | +impl Clone for s__bindgen_ty_1 { |
| 77 | + fn clone(&self) -> Self { *self } |
| 78 | +} |
| 79 | +#[test] |
| 80 | +fn bindgen_test_layout_s() { |
| 81 | + assert_eq!(::std::mem::size_of::<s>() , 4usize , concat ! ( |
| 82 | + "Size of: " , stringify ! ( s ) )); |
| 83 | + assert_eq! (::std::mem::align_of::<s>() , 4usize , concat ! ( |
| 84 | + "Alignment of " , stringify ! ( s ) )); |
| 85 | + assert_eq! (unsafe { & ( * ( 0 as * const s ) ) . u as * const _ as usize |
| 86 | + } , 0usize , concat ! ( |
| 87 | + "Alignment of field: " , stringify ! ( s ) , "::" , stringify |
| 88 | + ! ( u ) )); |
| 89 | +} |
| 90 | +impl Clone for s { |
| 91 | + fn clone(&self) -> Self { *self } |
| 92 | +} |
0 commit comments