2018-08-30 08:57:17 -05:00
|
|
|
//ignore-test FIXME: do some basic validation of invariants for all values in flight
|
2018-08-24 12:18:21 -05:00
|
|
|
//This does currently not get caught becuase it compiles to SwitchInt, which
|
|
|
|
//has no knowledge about data invariants.
|
2018-07-11 14:07:17 -05:00
|
|
|
|
2016-06-21 02:53:26 -05:00
|
|
|
fn main() {
|
|
|
|
assert!(std::char::from_u32(-1_i32 as u32).is_none());
|
2018-08-24 12:18:21 -05:00
|
|
|
let _ = match unsafe { std::mem::transmute::<i32, char>(-1) } { //~ ERROR constant evaluation error
|
2018-05-09 12:24:25 -05:00
|
|
|
//~^ NOTE tried to interpret an invalid 32-bit value as a char: 4294967295
|
2018-08-24 12:18:21 -05:00
|
|
|
'a' => {true},
|
|
|
|
'b' => {false},
|
|
|
|
_ => {true},
|
|
|
|
};
|
2016-06-21 02:53:26 -05:00
|
|
|
}
|