diff options
Diffstat (limited to 'tests/expectations/tests/constify-all-enums.rs')
-rw-r--r-- | tests/expectations/tests/constify-all-enums.rs | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/tests/expectations/tests/constify-all-enums.rs b/tests/expectations/tests/constify-all-enums.rs index 3627faae..c926d857 100644 --- a/tests/expectations/tests/constify-all-enums.rs +++ b/tests/expectations/tests/constify-all-enums.rs @@ -26,21 +26,24 @@ fn bindgen_test_layout_bar() { 4usize, 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).this_should_work) as usize - - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(bar), - "::", - stringify!(this_should_work) - ) - ); + fn test_field_this_should_work() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<bar>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).this_should_work) as usize - + ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(bar), + "::", + stringify!(this_should_work) + ) + ); + } + test_field_this_should_work(); } impl Default for bar { fn default() -> Self { |