Skip to content

Commit

Permalink
Adapt test to new layout
Browse files Browse the repository at this point in the history
  • Loading branch information
adwinwhite committed Sep 19, 2024
1 parent 9ac23dd commit c4574cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tools/miri/tests/fail/uninit/padding-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<E>).byte_add(mem::size_of::<&'static ()>()) as *const u8;
// Read a padding byte.
let _val = *c.add(0);
//~^ERROR: uninitialized
Expand Down

0 comments on commit c4574cb

Please sign in to comment.