Skip to content

Commit 81a556b

Browse files
committed
Adapt test to new layout
1 parent d45325c commit 81a556b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/fail/uninit/padding-enum.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ fn main() {
1717
assert!(matches!(*p.as_ptr(), E::None));
1818

1919
// Turns out the discriminant is (currently) stored
20-
// in the 2nd pointer, so the first half is padding.
21-
let c = &p as *const _ as *const u8;
20+
// in the 1st pointer, so the second half is padding.
21+
let c = (&p as *const mem::MaybeUninit<E>).byte_add(mem::size_of::<&'static ()>()) as *const u8;
2222
// Read a padding byte.
2323
let _val = *c.add(0);
2424
//~^ERROR: uninitialized

0 commit comments

Comments
 (0)