rust/src/test/ui/cast_char.rs
2019-04-30 22:43:51 +01:00

11 lines
281 B
Rust

#![deny(overflowing_literals)]
fn main() {
const XYZ: char = 0x1F888 as char;
//~^ ERROR only `u8` can be cast into `char`
const XY: char = 129160 as char;
//~^ ERROR only `u8` can be cast into `char`
const ZYX: char = '\u{01F888}';
println!("{}", XYZ);
}