mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-20 18:13:36 +00:00
8 lines
258 B
Rust
8 lines
258 B
Rust
#![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
|
|
}
|