|
8 | 8 | )]
|
9 | 9 |
|
10 | 10 | #[repr(C)]
|
11 |
| -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); |
12 |
| -impl<T> __BindgenUnionField<T> { |
13 |
| - #[inline] |
14 |
| - pub fn new() -> Self { |
15 |
| - __BindgenUnionField(::std::marker::PhantomData) |
16 |
| - } |
17 |
| - #[inline] |
18 |
| - pub unsafe fn as_ref(&self) -> &T { |
19 |
| - ::std::mem::transmute(self) |
20 |
| - } |
21 |
| - #[inline] |
22 |
| - pub unsafe fn as_mut(&mut self) -> &mut T { |
23 |
| - ::std::mem::transmute(self) |
24 |
| - } |
25 |
| -} |
26 |
| -impl<T> ::std::default::Default for __BindgenUnionField<T> { |
27 |
| - #[inline] |
28 |
| - fn default() -> Self { |
29 |
| - Self::new() |
30 |
| - } |
31 |
| -} |
32 |
| -impl<T> ::std::clone::Clone for __BindgenUnionField<T> { |
33 |
| - #[inline] |
34 |
| - fn clone(&self) -> Self { |
35 |
| - Self::new() |
36 |
| - } |
37 |
| -} |
38 |
| -impl<T> ::std::marker::Copy for __BindgenUnionField<T> {} |
39 |
| -impl<T> ::std::fmt::Debug for __BindgenUnionField<T> { |
40 |
| - fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { |
41 |
| - fmt.write_str("__BindgenUnionField") |
42 |
| - } |
43 |
| -} |
44 |
| -impl<T> ::std::hash::Hash for __BindgenUnionField<T> { |
45 |
| - fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {} |
46 |
| -} |
47 |
| -impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> { |
48 |
| - fn eq(&self, _other: &__BindgenUnionField<T>) -> bool { |
49 |
| - true |
50 |
| - } |
51 |
| -} |
52 |
| -impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {} |
53 |
| -#[repr(C)] |
| 11 | +#[derive(Copy, Clone)] |
54 | 12 | pub struct foo {
|
55 | 13 | pub bar: foo__bindgen_ty_1,
|
56 | 14 | }
|
57 | 15 | #[repr(C)]
|
58 |
| -pub struct foo__bindgen_ty_1 { |
59 |
| - pub a: __BindgenUnionField<::std::os::raw::c_uint>, |
60 |
| - pub b: __BindgenUnionField<::std::os::raw::c_ushort>, |
61 |
| - pub bindgen_union_field: u32, |
| 16 | +#[derive(Copy, Clone)] |
| 17 | +pub union foo__bindgen_ty_1 { |
| 18 | + pub a: ::std::os::raw::c_uint, |
| 19 | + pub b: ::std::os::raw::c_ushort, |
| 20 | + _bindgen_union_align: u32, |
62 | 21 | }
|
63 | 22 | #[test]
|
64 | 23 | fn bindgen_test_layout_foo__bindgen_ty_1() {
|
|
0 commit comments