summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/char_lit_as_u8.rs
blob: 7bb3daf0f1e72428fba440190450278bdbe18236 (plain)
1
2
3
4
5
6
7
8
#![warn(clippy::char_lit_as_u8)]

fn main() {
    // no suggestion, since a byte literal won't work.
    let _ = '❤' as u8;
    //~^ ERROR: casting a character literal to `u8` truncates
    //~| NOTE: `char` is four bytes wide, but `u8` is a single byte
}