11error: 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
33 |
44LL | let _ = true as u8;
55 | ^^^^^^^^^^ help: try: `u8::from(true)`
@@ -8,82 +8,88 @@ LL | let _ = true as u8;
88 = help: to override `-D warnings` add `#[allow(clippy::cast_lossless)]`
99
1010error: 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
1212 |
1313LL | let _ = true as u16;
1414 | ^^^^^^^^^^^ help: try: `u16::from(true)`
1515
1616error: 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
1818 |
1919LL | let _ = true as u32;
2020 | ^^^^^^^^^^^ help: try: `u32::from(true)`
2121
2222error: 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
2424 |
2525LL | let _ = true as u64;
2626 | ^^^^^^^^^^^ help: try: `u64::from(true)`
2727
2828error: 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
3030 |
3131LL | let _ = true as u128;
3232 | ^^^^^^^^^^^^ help: try: `u128::from(true)`
3333
3434error: 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
3636 |
3737LL | let _ = true as usize;
3838 | ^^^^^^^^^^^^^ help: try: `usize::from(true)`
3939
4040error: 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
4242 |
4343LL | let _ = true as i8;
4444 | ^^^^^^^^^^ help: try: `i8::from(true)`
4545
4646error: 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
4848 |
4949LL | let _ = true as i16;
5050 | ^^^^^^^^^^^ help: try: `i16::from(true)`
5151
5252error: 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
5454 |
5555LL | let _ = true as i32;
5656 | ^^^^^^^^^^^ help: try: `i32::from(true)`
5757
5858error: 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
6060 |
6161LL | let _ = true as i64;
6262 | ^^^^^^^^^^^ help: try: `i64::from(true)`
6363
6464error: 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
6666 |
6767LL | let _ = true as i128;
6868 | ^^^^^^^^^^^^ help: try: `i128::from(true)`
6969
7070error: 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
7272 |
7373LL | let _ = true as isize;
7474 | ^^^^^^^^^^^^^ help: try: `isize::from(true)`
7575
7676error: 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
7878 |
7979LL | let _ = (true | false) as u16;
8080 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::from(true | false)`
8181
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+
8288error: 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
8490 |
8591LL | let _ = true as u8;
8692 | ^^^^^^^^^^ help: try: `u8::from(true)`
8793
88- error: aborting due to 14 previous errors
94+ error: aborting due to 15 previous errors
8995
0 commit comments