summaryrefslogtreecommitdiff
path: root/tests/expectations/struct_with_nesting.rs
blob: ca5ec09e68440cc904fb42c5e2c8c1f768f6bdf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* automatically generated by rust-bindgen */


#![allow(non_snake_case)]


#[derive(Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
    #[inline]
    pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
    #[inline]
    pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
    #[inline]
    pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
    #[inline]
    fn default() -> Self { Self::new() }
}
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 foo {
    pub a: ::std::os::raw::c_uint,
    pub __bindgen_anon_1: foo__bindgen_ty_bindgen_id_3,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct foo__bindgen_ty_bindgen_id_3 {
    pub b: __BindgenUnionField<::std::os::raw::c_uint>,
    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 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,
}
#[test]
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::<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 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,
}
#[test]
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::<foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_8>()
               , 1usize);
}
impl Clone for foo__bindgen_ty_bindgen_id_3__bindgen_ty_bindgen_id_8 {
    fn clone(&self) -> Self { *self }
}
#[test]
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 }
}