]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/needless_bool/fixable.stderr
Merge pull request #16 from ian-h-chamberlain/feature/target-thread-local
[rust.git] / src / tools / clippy / tests / ui / needless_bool / fixable.stderr
1 error: this if-then-else expression returns a bool literal
2   --> $DIR/fixable.rs:41:5
3    |
4 LL | /     if x {
5 LL | |         true
6 LL | |     } else {
7 LL | |         false
8 LL | |     };
9    | |_____^ help: you can reduce it to: `x`
10    |
11    = note: `-D clippy::needless-bool` implied by `-D warnings`
12
13 error: this if-then-else expression returns a bool literal
14   --> $DIR/fixable.rs:46:5
15    |
16 LL | /     if x {
17 LL | |         false
18 LL | |     } else {
19 LL | |         true
20 LL | |     };
21    | |_____^ help: you can reduce it to: `!x`
22
23 error: this if-then-else expression returns a bool literal
24   --> $DIR/fixable.rs:51:5
25    |
26 LL | /     if x && y {
27 LL | |         false
28 LL | |     } else {
29 LL | |         true
30 LL | |     };
31    | |_____^ help: you can reduce it to: `!(x && y)`
32
33 error: this if-then-else expression returns a bool literal
34   --> $DIR/fixable.rs:59:5
35    |
36 LL | /     if a == b {
37 LL | |         false
38 LL | |     } else {
39 LL | |         true
40 LL | |     };
41    | |_____^ help: you can reduce it to: `a != b`
42
43 error: this if-then-else expression returns a bool literal
44   --> $DIR/fixable.rs:64:5
45    |
46 LL | /     if a != b {
47 LL | |         false
48 LL | |     } else {
49 LL | |         true
50 LL | |     };
51    | |_____^ help: you can reduce it to: `a == b`
52
53 error: this if-then-else expression returns a bool literal
54   --> $DIR/fixable.rs:69:5
55    |
56 LL | /     if a < b {
57 LL | |         false
58 LL | |     } else {
59 LL | |         true
60 LL | |     };
61    | |_____^ help: you can reduce it to: `a >= b`
62
63 error: this if-then-else expression returns a bool literal
64   --> $DIR/fixable.rs:74:5
65    |
66 LL | /     if a <= b {
67 LL | |         false
68 LL | |     } else {
69 LL | |         true
70 LL | |     };
71    | |_____^ help: you can reduce it to: `a > b`
72
73 error: this if-then-else expression returns a bool literal
74   --> $DIR/fixable.rs:79:5
75    |
76 LL | /     if a > b {
77 LL | |         false
78 LL | |     } else {
79 LL | |         true
80 LL | |     };
81    | |_____^ help: you can reduce it to: `a <= b`
82
83 error: this if-then-else expression returns a bool literal
84   --> $DIR/fixable.rs:84:5
85    |
86 LL | /     if a >= b {
87 LL | |         false
88 LL | |     } else {
89 LL | |         true
90 LL | |     };
91    | |_____^ help: you can reduce it to: `a < b`
92
93 error: this if-then-else expression returns a bool literal
94   --> $DIR/fixable.rs:105:5
95    |
96 LL | /     if x {
97 LL | |         return true;
98 LL | |     } else {
99 LL | |         return false;
100 LL | |     };
101    | |_____^ help: you can reduce it to: `return x`
102
103 error: this if-then-else expression returns a bool literal
104   --> $DIR/fixable.rs:113:5
105    |
106 LL | /     if x {
107 LL | |         return false;
108 LL | |     } else {
109 LL | |         return true;
110 LL | |     };
111    | |_____^ help: you can reduce it to: `return !x`
112
113 error: this if-then-else expression returns a bool literal
114   --> $DIR/fixable.rs:121:5
115    |
116 LL | /     if x && y {
117 LL | |         return true;
118 LL | |     } else {
119 LL | |         return false;
120 LL | |     };
121    | |_____^ help: you can reduce it to: `return x && y`
122
123 error: this if-then-else expression returns a bool literal
124   --> $DIR/fixable.rs:129:5
125    |
126 LL | /     if x && y {
127 LL | |         return false;
128 LL | |     } else {
129 LL | |         return true;
130 LL | |     };
131    | |_____^ help: you can reduce it to: `return !(x && y)`
132
133 error: equality checks against true are unnecessary
134   --> $DIR/fixable.rs:137:8
135    |
136 LL |     if x == true {};
137    |        ^^^^^^^^^ help: try simplifying it as shown: `x`
138    |
139    = note: `-D clippy::bool-comparison` implied by `-D warnings`
140
141 error: equality checks against false can be replaced by a negation
142   --> $DIR/fixable.rs:141:8
143    |
144 LL |     if x == false {};
145    |        ^^^^^^^^^^ help: try simplifying it as shown: `!x`
146
147 error: equality checks against true are unnecessary
148   --> $DIR/fixable.rs:151:8
149    |
150 LL |     if x == true {};
151    |        ^^^^^^^^^ help: try simplifying it as shown: `x`
152
153 error: equality checks against false can be replaced by a negation
154   --> $DIR/fixable.rs:152:8
155    |
156 LL |     if x == false {};
157    |        ^^^^^^^^^^ help: try simplifying it as shown: `!x`
158
159 error: this if-then-else expression returns a bool literal
160   --> $DIR/fixable.rs:161:12
161    |
162 LL |       } else if returns_bool() {
163    |  ____________^
164 LL | |         false
165 LL | |     } else {
166 LL | |         true
167 LL | |     };
168    | |_____^ help: you can reduce it to: `{ !returns_bool() }`
169
170 error: this if-then-else expression returns a bool literal
171   --> $DIR/fixable.rs:174:5
172    |
173 LL | /     if unsafe { no(4) } & 1 != 0 {
174 LL | |         true
175 LL | |     } else {
176 LL | |         false
177 LL | |     };
178    | |_____^ help: you can reduce it to: `(unsafe { no(4) } & 1 != 0)`
179
180 error: this if-then-else expression returns a bool literal
181   --> $DIR/fixable.rs:179:30
182    |
183 LL |     let _brackets_unneeded = if unsafe { no(4) } & 1 != 0 { true } else { false };
184    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `unsafe { no(4) } & 1 != 0`
185
186 error: this if-then-else expression returns a bool literal
187   --> $DIR/fixable.rs:182:9
188    |
189 LL |         if unsafe { no(4) } & 1 != 0 { true } else { false }
190    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `(unsafe { no(4) } & 1 != 0)`
191
192 error: aborting due to 21 previous errors
193