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