From c4574cba3bb0b24532f43dbacc2c738d4b20394d Mon Sep 17 00:00:00 2001 From: Adwin White Date: Thu, 19 Sep 2024 10:22:32 +0800 Subject: [PATCH] Adapt test to new layout --- src/tools/miri/tests/fail/uninit/padding-enum.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/miri/tests/fail/uninit/padding-enum.rs b/src/tools/miri/tests/fail/uninit/padding-enum.rs index a9628799b7d30..4ba059caf8b18 100644 --- a/src/tools/miri/tests/fail/uninit/padding-enum.rs +++ b/src/tools/miri/tests/fail/uninit/padding-enum.rs @@ -17,8 +17,8 @@ fn main() { assert!(matches!(*p.as_ptr(), E::None)); // Turns out the discriminant is (currently) stored - // in the 2nd pointer, so the first half is padding. - let c = &p as *const _ as *const u8; + // in the 1st pointer, so the second half is padding. + let c = (&p as *const mem::MaybeUninit).byte_add(mem::size_of::<&'static ()>()) as *const u8; // Read a padding byte. let _val = *c.add(0); //~^ERROR: uninitialized