2018-10-12 03:54:37 -05:00
|
|
|
// Validation makes this fail in the wrong place
|
2018-10-24 10:17:44 -05:00
|
|
|
// compile-flags: -Zmiri-disable-validation
|
2018-10-12 03:54:37 -05:00
|
|
|
|
2018-08-24 12:18:21 -05:00
|
|
|
fn main() {
|
|
|
|
assert!(std::char::from_u32(-1_i32 as u32).is_none());
|
|
|
|
let c = unsafe { std::mem::transmute::<i32, char>(-1) };
|
|
|
|
let _x = c == 'x'; //~ ERROR tried to interpret an invalid 32-bit value as a char
|
|
|
|
}
|