rust/tests/ui/cast/cast-char.rs

11 lines
281 B
Rust
Raw Normal View History

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