rust/src/test/ui/cast_char.rs

11 lines
273 B
Rust
Raw Normal View History

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