summaryrefslogtreecommitdiff
path: root/tests/expectations/tests/forward-declaration-autoptr.rs
blob: 08ee31efdbc521f32643b28d3f78ecb46a8fefba (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
/* automatically generated by rust-bindgen */


#![allow(non_snake_case)]


#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Foo {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RefPtr<T> {
    pub m_inner: *mut T,
    pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl <T> Default for RefPtr<T> {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Bar {
    pub m_member: RefPtr<Foo>,
}
#[test]
fn bindgen_test_layout_Bar() {
    assert_eq!(::std::mem::size_of::<Bar>() , 8usize , concat ! (
               "Size of: " , stringify ! ( Bar ) ));
    assert_eq! (::std::mem::align_of::<Bar>() , 8usize , concat ! (
                "Alignment of " , stringify ! ( Bar ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const Bar ) ) . m_member as * const _ as usize
                } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( Bar ) , "::" ,
                stringify ! ( m_member ) ));
}
impl Clone for Bar {
    fn clone(&self) -> Self { *self }
}
impl Default for Bar {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}