2018-10-12 10:54:37 +02:00
|
|
|
// Validation makes this fail in the wrong place
|
2020-04-14 09:58:58 +02:00
|
|
|
// Make sure we find these even with many checks disabled.
|
|
|
|
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
2021-04-25 16:57:48 +02:00
|
|
|
#![feature(bench_black_box)]
|
2020-09-07 10:24:04 +02:00
|
|
|
|
2018-08-24 19:18:21 +02:00
|
|
|
fn main() {
|
|
|
|
let b = unsafe { std::mem::transmute::<u8, bool>(2) };
|
2022-03-17 13:49:10 +00:00
|
|
|
let _x = b == std::hint::black_box(true); //~ ERROR interpreting an invalid 8-bit value as a bool
|
2018-08-24 19:18:21 +02:00
|
|
|
}
|