summaryrefslogtreecommitdiff
path: root/tests/expectations/tests/class_with_dtor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/expectations/tests/class_with_dtor.rs')
-rw-r--r--tests/expectations/tests/class_with_dtor.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/expectations/tests/class_with_dtor.rs b/tests/expectations/tests/class_with_dtor.rs
index 0cf2d8d2..e94e8e5f 100644
--- a/tests/expectations/tests/class_with_dtor.rs
+++ b/tests/expectations/tests/class_with_dtor.rs
@@ -40,8 +40,10 @@ fn bindgen_test_layout_WithoutDtor() {
);
assert_eq!(
unsafe {
- &(*(::std::ptr::null::<WithoutDtor>())).shouldBeWithDtor as *const _
- as usize
+ let uninit = ::std::mem::MaybeUninit::<WithoutDtor>::uninit();
+ let ptr = uninit.as_ptr();
+ ::std::ptr::addr_of!((*ptr).shouldBeWithDtor) as usize -
+ ptr as usize
},
0usize,
concat!(