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