7 fn evil(x: &mut Bool) {
8 let x = x as *mut _ as *mut u32;
9 unsafe { *x = 44 }; // out-of-bounds enum tag
12 #[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/5391
14 let mut x = Bool::True;
16 let y = x; // reading this ought to be enough to trigger validation
17 //~^ ERROR: constructing invalid value at .<enum-tag>: encountered 0x0000002c, but expected a valid enum tag
18 println!("{:?}", y); // make sure it is used (and not optimized away)