|
1 | 1 | error: casting `bool` to `u8` is more cleanly stated with `u8::from(_)`
|
2 |
| - --> $DIR/cast_lossless_bool.rs:8:13 |
| 2 | + --> $DIR/cast_lossless_bool.rs:10: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 | 9 | error: casting `bool` to `u16` is more cleanly stated with `u16::from(_)`
|
10 |
| - --> $DIR/cast_lossless_bool.rs:9:13 |
| 10 | + --> $DIR/cast_lossless_bool.rs:11:13 |
11 | 11 | |
|
12 | 12 | LL | let _ = true as u16;
|
13 | 13 | | ^^^^^^^^^^^ help: try: `u16::from(true)`
|
14 | 14 |
|
15 | 15 | error: casting `bool` to `u32` is more cleanly stated with `u32::from(_)`
|
16 |
| - --> $DIR/cast_lossless_bool.rs:10:13 |
| 16 | + --> $DIR/cast_lossless_bool.rs:12:13 |
17 | 17 | |
|
18 | 18 | LL | let _ = true as u32;
|
19 | 19 | | ^^^^^^^^^^^ help: try: `u32::from(true)`
|
20 | 20 |
|
21 | 21 | error: casting `bool` to `u64` is more cleanly stated with `u64::from(_)`
|
22 |
| - --> $DIR/cast_lossless_bool.rs:11:13 |
| 22 | + --> $DIR/cast_lossless_bool.rs:13:13 |
23 | 23 | |
|
24 | 24 | LL | let _ = true as u64;
|
25 | 25 | | ^^^^^^^^^^^ help: try: `u64::from(true)`
|
26 | 26 |
|
27 | 27 | error: casting `bool` to `u128` is more cleanly stated with `u128::from(_)`
|
28 |
| - --> $DIR/cast_lossless_bool.rs:12:13 |
| 28 | + --> $DIR/cast_lossless_bool.rs:14:13 |
29 | 29 | |
|
30 | 30 | LL | let _ = true as u128;
|
31 | 31 | | ^^^^^^^^^^^^ help: try: `u128::from(true)`
|
32 | 32 |
|
33 | 33 | error: casting `bool` to `usize` is more cleanly stated with `usize::from(_)`
|
34 |
| - --> $DIR/cast_lossless_bool.rs:13:13 |
| 34 | + --> $DIR/cast_lossless_bool.rs:15:13 |
35 | 35 | |
|
36 | 36 | LL | let _ = true as usize;
|
37 | 37 | | ^^^^^^^^^^^^^ help: try: `usize::from(true)`
|
38 | 38 |
|
39 | 39 | error: casting `bool` to `i8` is more cleanly stated with `i8::from(_)`
|
40 |
| - --> $DIR/cast_lossless_bool.rs:15:13 |
| 40 | + --> $DIR/cast_lossless_bool.rs:17:13 |
41 | 41 | |
|
42 | 42 | LL | let _ = true as i8;
|
43 | 43 | | ^^^^^^^^^^ help: try: `i8::from(true)`
|
44 | 44 |
|
45 | 45 | error: casting `bool` to `i16` is more cleanly stated with `i16::from(_)`
|
46 |
| - --> $DIR/cast_lossless_bool.rs:16:13 |
| 46 | + --> $DIR/cast_lossless_bool.rs:18:13 |
47 | 47 | |
|
48 | 48 | LL | let _ = true as i16;
|
49 | 49 | | ^^^^^^^^^^^ help: try: `i16::from(true)`
|
50 | 50 |
|
51 | 51 | error: casting `bool` to `i32` is more cleanly stated with `i32::from(_)`
|
52 |
| - --> $DIR/cast_lossless_bool.rs:17:13 |
| 52 | + --> $DIR/cast_lossless_bool.rs:19:13 |
53 | 53 | |
|
54 | 54 | LL | let _ = true as i32;
|
55 | 55 | | ^^^^^^^^^^^ help: try: `i32::from(true)`
|
56 | 56 |
|
57 | 57 | error: casting `bool` to `i64` is more cleanly stated with `i64::from(_)`
|
58 |
| - --> $DIR/cast_lossless_bool.rs:18:13 |
| 58 | + --> $DIR/cast_lossless_bool.rs:20:13 |
59 | 59 | |
|
60 | 60 | LL | let _ = true as i64;
|
61 | 61 | | ^^^^^^^^^^^ help: try: `i64::from(true)`
|
62 | 62 |
|
63 | 63 | error: casting `bool` to `i128` is more cleanly stated with `i128::from(_)`
|
64 |
| - --> $DIR/cast_lossless_bool.rs:19:13 |
| 64 | + --> $DIR/cast_lossless_bool.rs:21:13 |
65 | 65 | |
|
66 | 66 | LL | let _ = true as i128;
|
67 | 67 | | ^^^^^^^^^^^^ help: try: `i128::from(true)`
|
68 | 68 |
|
69 | 69 | error: casting `bool` to `isize` is more cleanly stated with `isize::from(_)`
|
70 |
| - --> $DIR/cast_lossless_bool.rs:20:13 |
| 70 | + --> $DIR/cast_lossless_bool.rs:22:13 |
71 | 71 | |
|
72 | 72 | LL | let _ = true as isize;
|
73 | 73 | | ^^^^^^^^^^^^^ help: try: `isize::from(true)`
|
74 | 74 |
|
75 | 75 | error: casting `bool` to `u16` is more cleanly stated with `u16::from(_)`
|
76 |
| - --> $DIR/cast_lossless_bool.rs:23:13 |
| 76 | + --> $DIR/cast_lossless_bool.rs:25:13 |
77 | 77 | |
|
78 | 78 | LL | let _ = (true | false) as u16;
|
79 | 79 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::from(true | false)`
|
80 | 80 |
|
| 81 | +error: casting `bool` to `U8` is more cleanly stated with `U8::from(_)` |
| 82 | + --> $DIR/cast_lossless_bool.rs:27:13 |
| 83 | + | |
| 84 | +LL | let _ = true as U8; |
| 85 | + | ^^^^^^^^^^ help: try: `U8::from(true)` |
| 86 | + |
81 | 87 | error: casting `bool` to `u8` is more cleanly stated with `u8::from(_)`
|
82 |
| - --> $DIR/cast_lossless_bool.rs:51:13 |
| 88 | + --> $DIR/cast_lossless_bool.rs:55:13 |
83 | 89 | |
|
84 | 90 | LL | let _ = true as u8;
|
85 | 91 | | ^^^^^^^^^^ help: try: `u8::from(true)`
|
86 | 92 |
|
87 |
| -error: aborting due to 14 previous errors |
| 93 | +error: aborting due to 15 previous errors |
88 | 94 |
|
0 commit comments