summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/cast_lossless_bool.stderr
blob: 768b033d10a28add2d6b2383346567d39edd0fc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
error: casting `bool` to `u8` is more cleanly stated with `u8::from(_)`
  --> $DIR/cast_lossless_bool.rs:9:13
   |
LL |     let _ = true as u8;
   |             ^^^^^^^^^^ help: try: `u8::from(true)`
   |
   = note: `-D clippy::cast-lossless` implied by `-D warnings`

error: casting `bool` to `u16` is more cleanly stated with `u16::from(_)`
  --> $DIR/cast_lossless_bool.rs:10:13
   |
LL |     let _ = true as u16;
   |             ^^^^^^^^^^^ help: try: `u16::from(true)`

error: casting `bool` to `u32` is more cleanly stated with `u32::from(_)`
  --> $DIR/cast_lossless_bool.rs:11:13
   |
LL |     let _ = true as u32;
   |             ^^^^^^^^^^^ help: try: `u32::from(true)`

error: casting `bool` to `u64` is more cleanly stated with `u64::from(_)`
  --> $DIR/cast_lossless_bool.rs:12:13
   |
LL |     let _ = true as u64;
   |             ^^^^^^^^^^^ help: try: `u64::from(true)`

error: casting `bool` to `u128` is more cleanly stated with `u128::from(_)`
  --> $DIR/cast_lossless_bool.rs:13:13
   |
LL |     let _ = true as u128;
   |             ^^^^^^^^^^^^ help: try: `u128::from(true)`

error: casting `bool` to `usize` is more cleanly stated with `usize::from(_)`
  --> $DIR/cast_lossless_bool.rs:14:13
   |
LL |     let _ = true as usize;
   |             ^^^^^^^^^^^^^ help: try: `usize::from(true)`

error: casting `bool` to `i8` is more cleanly stated with `i8::from(_)`
  --> $DIR/cast_lossless_bool.rs:16:13
   |
LL |     let _ = true as i8;
   |             ^^^^^^^^^^ help: try: `i8::from(true)`

error: casting `bool` to `i16` is more cleanly stated with `i16::from(_)`
  --> $DIR/cast_lossless_bool.rs:17:13
   |
LL |     let _ = true as i16;
   |             ^^^^^^^^^^^ help: try: `i16::from(true)`

error: casting `bool` to `i32` is more cleanly stated with `i32::from(_)`
  --> $DIR/cast_lossless_bool.rs:18:13
   |
LL |     let _ = true as i32;
   |             ^^^^^^^^^^^ help: try: `i32::from(true)`

error: casting `bool` to `i64` is more cleanly stated with `i64::from(_)`
  --> $DIR/cast_lossless_bool.rs:19:13
   |
LL |     let _ = true as i64;
   |             ^^^^^^^^^^^ help: try: `i64::from(true)`

error: casting `bool` to `i128` is more cleanly stated with `i128::from(_)`
  --> $DIR/cast_lossless_bool.rs:20:13
   |
LL |     let _ = true as i128;
   |             ^^^^^^^^^^^^ help: try: `i128::from(true)`

error: casting `bool` to `isize` is more cleanly stated with `isize::from(_)`
  --> $DIR/cast_lossless_bool.rs:21:13
   |
LL |     let _ = true as isize;
   |             ^^^^^^^^^^^^^ help: try: `isize::from(true)`

error: casting `bool` to `u16` is more cleanly stated with `u16::from(_)`
  --> $DIR/cast_lossless_bool.rs:24:13
   |
LL |     let _ = (true | false) as u16;
   |             ^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::from(true | false)`

error: casting `bool` to `u8` is more cleanly stated with `u8::from(_)`
  --> $DIR/cast_lossless_bool.rs:54:13
   |
LL |     let _ = true as u8;
   |             ^^^^^^^^^^ help: try: `u8::from(true)`

error: aborting due to 14 previous errors