]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/bool_to_int_with_if.stderr
Merge commit '7248d06384c6a90de58c04c1f46be88821278d8b' into sync-from-clippy
[rust.git] / src / tools / clippy / tests / ui / bool_to_int_with_if.stderr
1 error: boolean to int conversion using if
2   --> $DIR/bool_to_int_with_if.rs:15:5
3    |
4 LL | /     if a {
5 LL | |         1
6 LL | |     } else {
7 LL | |         0
8 LL | |     };
9    | |_____^ help: replace with from: `i32::from(a)`
10    |
11    = note: `-D clippy::bool-to-int-with-if` implied by `-D warnings`
12    = note: `a as i32` or `a.into()` can also be valid options
13
14 error: boolean to int conversion using if
15   --> $DIR/bool_to_int_with_if.rs:20:5
16    |
17 LL | /     if a {
18 LL | |         0
19 LL | |     } else {
20 LL | |         1
21 LL | |     };
22    | |_____^ help: replace with from: `i32::from(!a)`
23    |
24    = note: `!a as i32` or `(!a).into()` can also be valid options
25
26 error: boolean to int conversion using if
27   --> $DIR/bool_to_int_with_if.rs:25:5
28    |
29 LL | /     if !a {
30 LL | |         1
31 LL | |     } else {
32 LL | |         0
33 LL | |     };
34    | |_____^ help: replace with from: `i32::from(!a)`
35    |
36    = note: `!a as i32` or `(!a).into()` can also be valid options
37
38 error: boolean to int conversion using if
39   --> $DIR/bool_to_int_with_if.rs:30:5
40    |
41 LL | /     if a || b {
42 LL | |         1
43 LL | |     } else {
44 LL | |         0
45 LL | |     };
46    | |_____^ help: replace with from: `i32::from(a || b)`
47    |
48    = note: `(a || b) as i32` or `(a || b).into()` can also be valid options
49
50 error: boolean to int conversion using if
51   --> $DIR/bool_to_int_with_if.rs:35:5
52    |
53 LL | /     if cond(a, b) {
54 LL | |         1
55 LL | |     } else {
56 LL | |         0
57 LL | |     };
58    | |_____^ help: replace with from: `i32::from(cond(a, b))`
59    |
60    = note: `cond(a, b) as i32` or `cond(a, b).into()` can also be valid options
61
62 error: boolean to int conversion using if
63   --> $DIR/bool_to_int_with_if.rs:40:5
64    |
65 LL | /     if x + y < 4 {
66 LL | |         1
67 LL | |     } else {
68 LL | |         0
69 LL | |     };
70    | |_____^ help: replace with from: `i32::from(x + y < 4)`
71    |
72    = note: `(x + y < 4) as i32` or `(x + y < 4).into()` can also be valid options
73
74 error: boolean to int conversion using if
75   --> $DIR/bool_to_int_with_if.rs:49:12
76    |
77 LL |       } else if b {
78    |  ____________^
79 LL | |         1
80 LL | |     } else {
81 LL | |         0
82 LL | |     };
83    | |_____^ help: replace with from: `{ i32::from(b) }`
84    |
85    = note: `b as i32` or `b.into()` can also be valid options
86
87 error: boolean to int conversion using if
88   --> $DIR/bool_to_int_with_if.rs:58:12
89    |
90 LL |       } else if b {
91    |  ____________^
92 LL | |         0
93 LL | |     } else {
94 LL | |         1
95 LL | |     };
96    | |_____^ help: replace with from: `{ i32::from(!b) }`
97    |
98    = note: `!b as i32` or `(!b).into()` can also be valid options
99
100 error: boolean to int conversion using if
101   --> $DIR/bool_to_int_with_if.rs:116:5
102    |
103 LL |     if a { 1 } else { 0 }
104    |     ^^^^^^^^^^^^^^^^^^^^^ help: replace with from: `u8::from(a)`
105    |
106    = note: `a as u8` or `a.into()` can also be valid options
107
108 error: aborting due to 9 previous errors
109