diff options
Diffstat (limited to 'tests/expectations/tests/no-hash-allowlisted.rs')
-rw-r--r-- | tests/expectations/tests/no-hash-allowlisted.rs | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/expectations/tests/no-hash-allowlisted.rs b/tests/expectations/tests/no-hash-allowlisted.rs index f060b729..43132cb0 100644 --- a/tests/expectations/tests/no-hash-allowlisted.rs +++ b/tests/expectations/tests/no-hash-allowlisted.rs @@ -22,13 +22,21 @@ fn bindgen_test_layout_NoHash() { 4usize, concat!("Alignment of ", stringify!(NoHash)) ); - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<NoHash>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).i) as usize - ptr as usize - }, - 0usize, - concat!("Offset of field: ", stringify!(NoHash), "::", stringify!(i)) - ); + fn test_field_i() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<NoHash>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).i) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(NoHash), + "::", + stringify!(i) + ) + ); + } + test_field_i(); } |