fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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