]> git.lizzy.rs Git - rust.git/blob - tests/ui/char_lit_as_u8_suggestions.stderr
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / char_lit_as_u8_suggestions.stderr
1 error: casting a character literal to `u8` truncates
2   --> $DIR/char_lit_as_u8_suggestions.rs:6:13
3    |
4 LL |     let _ = 'a' as u8;
5    |             ^^^^^^^^^ help: use a byte literal instead: `b'a'`
6    |
7    = note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
8    = note: `char` is four bytes wide, but `u8` is a single byte
9
10 error: casting a character literal to `u8` truncates
11   --> $DIR/char_lit_as_u8_suggestions.rs:7:13
12    |
13 LL |     let _ = '/n' as u8;
14    |             ^^^^^^^^^^ help: use a byte literal instead: `b'/n'`
15    |
16    = note: `char` is four bytes wide, but `u8` is a single byte
17
18 error: casting a character literal to `u8` truncates
19   --> $DIR/char_lit_as_u8_suggestions.rs:8:13
20    |
21 LL |     let _ = '/0' as u8;
22    |             ^^^^^^^^^^ help: use a byte literal instead: `b'/0'`
23    |
24    = note: `char` is four bytes wide, but `u8` is a single byte
25
26 error: casting a character literal to `u8` truncates
27   --> $DIR/char_lit_as_u8_suggestions.rs:9:13
28    |
29 LL |     let _ = '/x01' as u8;
30    |             ^^^^^^^^^^^^ help: use a byte literal instead: `b'/x01'`
31    |
32    = note: `char` is four bytes wide, but `u8` is a single byte
33
34 error: aborting due to 4 previous errors
35