diff options
Diffstat (limited to 'tests/expectations/tests/derive-partialeq-and-blocklist.rs')
-rw-r--r-- | tests/expectations/tests/derive-partialeq-and-blocklist.rs | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/tests/expectations/tests/derive-partialeq-and-blocklist.rs b/tests/expectations/tests/derive-partialeq-and-blocklist.rs index e3d81277..23c493dc 100644 --- a/tests/expectations/tests/derive-partialeq-and-blocklist.rs +++ b/tests/expectations/tests/derive-partialeq-and-blocklist.rs @@ -25,21 +25,25 @@ fn bindgen_test_layout_ShouldNotDerivePartialEq() { 1usize, concat!("Alignment of ", stringify!(ShouldNotDerivePartialEq)) ); - assert_eq!( - unsafe { - let uninit = - ::std::mem::MaybeUninit::<ShouldNotDerivePartialEq>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ShouldNotDerivePartialEq), - "::", - stringify!(a) - ) - ); + fn test_field_a() { + assert_eq!( + unsafe { + let uninit = + ::std::mem::MaybeUninit::<ShouldNotDerivePartialEq>::uninit( + ); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ShouldNotDerivePartialEq), + "::", + stringify!(a) + ) + ); + } + test_field_a(); } impl Default for ShouldNotDerivePartialEq { fn default() -> Self { |