summaryrefslogtreecommitdiff
path: root/tests/expectations/tests/blocklist-and-impl-debug.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/expectations/tests/blocklist-and-impl-debug.rs')
-rw-r--r--tests/expectations/tests/blocklist-and-impl-debug.rs34
1 files changed, 19 insertions, 15 deletions
diff --git a/tests/expectations/tests/blocklist-and-impl-debug.rs b/tests/expectations/tests/blocklist-and-impl-debug.rs
index 2cb1fef3..055cca8c 100644
--- a/tests/expectations/tests/blocklist-and-impl-debug.rs
+++ b/tests/expectations/tests/blocklist-and-impl-debug.rs
@@ -24,21 +24,25 @@ fn bindgen_test_layout_ShouldManuallyImplDebug() {
1usize,
concat!("Alignment of ", stringify!(ShouldManuallyImplDebug))
);
- assert_eq!(
- unsafe {
- let uninit =
- ::std::mem::MaybeUninit::<ShouldManuallyImplDebug>::uninit();
- let ptr = uninit.as_ptr();
- ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize
- },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ShouldManuallyImplDebug),
- "::",
- stringify!(a)
- )
- );
+ fn test_field_a() {
+ assert_eq!(
+ unsafe {
+ let uninit =
+ ::std::mem::MaybeUninit::<ShouldManuallyImplDebug>::uninit(
+ );
+ let ptr = uninit.as_ptr();
+ ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(ShouldManuallyImplDebug),
+ "::",
+ stringify!(a)
+ )
+ );
+ }
+ test_field_a();
}
impl Default for ShouldManuallyImplDebug {
fn default() -> Self {