2018-07-28 10:34:52 -05:00
|
|
|
#![warn(clippy::char_lit_as_u8)]
|
2019-08-19 21:24:07 -05:00
|
|
|
|
2016-01-27 13:23:59 -06:00
|
|
|
fn main() {
|
2023-08-24 14:32:12 -05:00
|
|
|
// 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
|
2016-01-27 13:23:59 -06:00
|
|
|
}
|