2018-10-12 03:54:37 -05:00
|
|
|
fn main() {
|
|
|
|
assert!(std::char::from_u32(-1_i32 as u32).is_none());
|
2022-06-22 00:56:50 -05:00
|
|
|
let _val = match unsafe { std::mem::transmute::<i32, char>(-1) } {
|
2022-07-11 06:44:55 -05:00
|
|
|
//~^ ERROR: encountered 0xffffffff, but expected a valid unicode scalar value
|
2022-06-22 00:56:50 -05:00
|
|
|
'a' => true,
|
|
|
|
'b' => false,
|
|
|
|
_ => true,
|
2018-10-12 03:54:37 -05:00
|
|
|
};
|
|
|
|
}
|