|
1 |
| -error: casting `bool` to `u8` may become silently lossy if you later change the type |
| 1 | +error: casting `bool` to `u8` is more cleanly stated with `u8::from(_)` |
2 | 2 | --> $DIR/cast_lossless_bool.rs:8:13
|
3 | 3 | |
|
4 | 4 | LL | let _ = true as u8;
|
5 | 5 | | ^^^^^^^^^^ help: try: `u8::from(true)`
|
6 | 6 | |
|
7 | 7 | = note: `-D clippy::cast-lossless` implied by `-D warnings`
|
8 | 8 |
|
9 |
| -error: casting `bool` to `u16` may become silently lossy if you later change the type |
| 9 | +error: casting `bool` to `u16` is more cleanly stated with `u16::from(_)` |
10 | 10 | --> $DIR/cast_lossless_bool.rs:9:13
|
11 | 11 | |
|
12 | 12 | LL | let _ = true as u16;
|
13 | 13 | | ^^^^^^^^^^^ help: try: `u16::from(true)`
|
14 | 14 |
|
15 |
| -error: casting `bool` to `u32` may become silently lossy if you later change the type |
| 15 | +error: casting `bool` to `u32` is more cleanly stated with `u32::from(_)` |
16 | 16 | --> $DIR/cast_lossless_bool.rs:10:13
|
17 | 17 | |
|
18 | 18 | LL | let _ = true as u32;
|
19 | 19 | | ^^^^^^^^^^^ help: try: `u32::from(true)`
|
20 | 20 |
|
21 |
| -error: casting `bool` to `u64` may become silently lossy if you later change the type |
| 21 | +error: casting `bool` to `u64` is more cleanly stated with `u64::from(_)` |
22 | 22 | --> $DIR/cast_lossless_bool.rs:11:13
|
23 | 23 | |
|
24 | 24 | LL | let _ = true as u64;
|
25 | 25 | | ^^^^^^^^^^^ help: try: `u64::from(true)`
|
26 | 26 |
|
27 |
| -error: casting `bool` to `u128` may become silently lossy if you later change the type |
| 27 | +error: casting `bool` to `u128` is more cleanly stated with `u128::from(_)` |
28 | 28 | --> $DIR/cast_lossless_bool.rs:12:13
|
29 | 29 | |
|
30 | 30 | LL | let _ = true as u128;
|
31 | 31 | | ^^^^^^^^^^^^ help: try: `u128::from(true)`
|
32 | 32 |
|
33 |
| -error: casting `bool` to `usize` may become silently lossy if you later change the type |
| 33 | +error: casting `bool` to `usize` is more cleanly stated with `usize::from(_)` |
34 | 34 | --> $DIR/cast_lossless_bool.rs:13:13
|
35 | 35 | |
|
36 | 36 | LL | let _ = true as usize;
|
37 | 37 | | ^^^^^^^^^^^^^ help: try: `usize::from(true)`
|
38 | 38 |
|
39 |
| -error: casting `bool` to `i8` may become silently lossy if you later change the type |
| 39 | +error: casting `bool` to `i8` is more cleanly stated with `i8::from(_)` |
40 | 40 | --> $DIR/cast_lossless_bool.rs:15:13
|
41 | 41 | |
|
42 | 42 | LL | let _ = true as i8;
|
43 | 43 | | ^^^^^^^^^^ help: try: `i8::from(true)`
|
44 | 44 |
|
45 |
| -error: casting `bool` to `i16` may become silently lossy if you later change the type |
| 45 | +error: casting `bool` to `i16` is more cleanly stated with `i16::from(_)` |
46 | 46 | --> $DIR/cast_lossless_bool.rs:16:13
|
47 | 47 | |
|
48 | 48 | LL | let _ = true as i16;
|
49 | 49 | | ^^^^^^^^^^^ help: try: `i16::from(true)`
|
50 | 50 |
|
51 |
| -error: casting `bool` to `i32` may become silently lossy if you later change the type |
| 51 | +error: casting `bool` to `i32` is more cleanly stated with `i32::from(_)` |
52 | 52 | --> $DIR/cast_lossless_bool.rs:17:13
|
53 | 53 | |
|
54 | 54 | LL | let _ = true as i32;
|
55 | 55 | | ^^^^^^^^^^^ help: try: `i32::from(true)`
|
56 | 56 |
|
57 |
| -error: casting `bool` to `i64` may become silently lossy if you later change the type |
| 57 | +error: casting `bool` to `i64` is more cleanly stated with `i64::from(_)` |
58 | 58 | --> $DIR/cast_lossless_bool.rs:18:13
|
59 | 59 | |
|
60 | 60 | LL | let _ = true as i64;
|
61 | 61 | | ^^^^^^^^^^^ help: try: `i64::from(true)`
|
62 | 62 |
|
63 |
| -error: casting `bool` to `i128` may become silently lossy if you later change the type |
| 63 | +error: casting `bool` to `i128` is more cleanly stated with `i128::from(_)` |
64 | 64 | --> $DIR/cast_lossless_bool.rs:19:13
|
65 | 65 | |
|
66 | 66 | LL | let _ = true as i128;
|
67 | 67 | | ^^^^^^^^^^^^ help: try: `i128::from(true)`
|
68 | 68 |
|
69 |
| -error: casting `bool` to `isize` may become silently lossy if you later change the type |
| 69 | +error: casting `bool` to `isize` is more cleanly stated with `isize::from(_)` |
70 | 70 | --> $DIR/cast_lossless_bool.rs:20:13
|
71 | 71 | |
|
72 | 72 | LL | let _ = true as isize;
|
73 | 73 | | ^^^^^^^^^^^^^ help: try: `isize::from(true)`
|
74 | 74 |
|
75 |
| -error: casting `bool` to `u16` may become silently lossy if you later change the type |
| 75 | +error: casting `bool` to `u16` is more cleanly stated with `u16::from(_)` |
76 | 76 | --> $DIR/cast_lossless_bool.rs:23:13
|
77 | 77 | |
|
78 | 78 | LL | let _ = (true | false) as u16;
|
|
0 commit comments