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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
281 B
Rust
Raw Normal View History

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