diff options
Diffstat (limited to 'tests/expectations/crtp.rs')
-rw-r--r-- | tests/expectations/crtp.rs | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/tests/expectations/crtp.rs b/tests/expectations/crtp.rs index c6964524..e4a86b24 100644 --- a/tests/expectations/crtp.rs +++ b/tests/expectations/crtp.rs @@ -7,23 +7,37 @@ #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Base<T> { - pub _phantom0: ::std::marker::PhantomData<T>, + pub _address: u8, + pub _phantom_0: ::std::marker::PhantomData<T>, } #[repr(C)] #[derive(Debug, Copy)] pub struct Derived { - pub _base: Base<Derived>, + pub _address: u8, } -impl ::std::clone::Clone for Derived { +#[test] +fn bindgen_test_layout_Derived() { + assert_eq!(::std::mem::size_of::<Derived>() , 1usize); + assert_eq!(::std::mem::align_of::<Derived>() , 1usize); +} +impl Clone for Derived { fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Debug)] pub struct BaseWithDestructor<T> { - pub _phantom0: ::std::marker::PhantomData<T>, + pub _address: u8, + pub _phantom_0: ::std::marker::PhantomData<T>, } #[repr(C)] #[derive(Debug)] pub struct DerivedFromBaseWithDestructor { - pub _base: BaseWithDestructor<DerivedFromBaseWithDestructor>, + pub _address: u8, +} +#[test] +fn bindgen_test_layout_DerivedFromBaseWithDestructor() { + assert_eq!(::std::mem::size_of::<DerivedFromBaseWithDestructor>() , + 1usize); + assert_eq!(::std::mem::align_of::<DerivedFromBaseWithDestructor>() , + 1usize); } |