diff options
Diffstat (limited to 'tests/expectations/tests/class_with_dtor.rs')
-rw-r--r-- | tests/expectations/tests/class_with_dtor.rs | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/tests/expectations/tests/class_with_dtor.rs b/tests/expectations/tests/class_with_dtor.rs index e94e8e5f..a6e75867 100644 --- a/tests/expectations/tests/class_with_dtor.rs +++ b/tests/expectations/tests/class_with_dtor.rs @@ -38,21 +38,24 @@ fn bindgen_test_layout_WithoutDtor() { 8usize, concat!("Alignment of ", stringify!(WithoutDtor)) ); - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<WithoutDtor>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).shouldBeWithDtor) as usize - - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(WithoutDtor), - "::", - stringify!(shouldBeWithDtor) - ) - ); + fn test_field_shouldBeWithDtor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<WithoutDtor>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).shouldBeWithDtor) as usize - + ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(WithoutDtor), + "::", + stringify!(shouldBeWithDtor) + ) + ); + } + test_field_shouldBeWithDtor(); } impl Default for WithoutDtor { fn default() -> Self { |