diff options
Diffstat (limited to 'tests/expectations/tests/forward-declaration-autoptr.rs')
-rw-r--r-- | tests/expectations/tests/forward-declaration-autoptr.rs | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/tests/expectations/tests/forward-declaration-autoptr.rs b/tests/expectations/tests/forward-declaration-autoptr.rs index 022089d0..f46f73b6 100644 --- a/tests/expectations/tests/forward-declaration-autoptr.rs +++ b/tests/expectations/tests/forward-declaration-autoptr.rs @@ -42,20 +42,23 @@ fn bindgen_test_layout_Bar() { 8usize, concat!("Alignment of ", stringify!(Bar)) ); - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<Bar>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).m_member) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Bar), - "::", - stringify!(m_member) - ) - ); + fn test_field_m_member() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<Bar>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).m_member) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(Bar), + "::", + stringify!(m_member) + ) + ); + } + test_field_m_member(); } impl Default for Bar { fn default() -> Self { |