@@ -91,7 +91,7 @@ LL | | };
91
91
| |_____^ help: you can reduce it to: `a < b`
92
92
93
93
error: this if-then-else expression returns a bool literal
94
- --> $DIR/fixable.rs:105 :5
94
+ --> $DIR/fixable.rs:112 :5
95
95
|
96
96
LL | / if x {
97
97
LL | | return true;
@@ -101,7 +101,7 @@ LL | | };
101
101
| |_____^ help: you can reduce it to: `return x`
102
102
103
103
error: this if-then-else expression returns a bool literal
104
- --> $DIR/fixable.rs:113 :5
104
+ --> $DIR/fixable.rs:120 :5
105
105
|
106
106
LL | / if x {
107
107
LL | | return false;
@@ -111,7 +111,7 @@ LL | | };
111
111
| |_____^ help: you can reduce it to: `return !x`
112
112
113
113
error: this if-then-else expression returns a bool literal
114
- --> $DIR/fixable.rs:121 :5
114
+ --> $DIR/fixable.rs:128 :5
115
115
|
116
116
LL | / if x && y {
117
117
LL | | return true;
@@ -121,7 +121,7 @@ LL | | };
121
121
| |_____^ help: you can reduce it to: `return x && y`
122
122
123
123
error: this if-then-else expression returns a bool literal
124
- --> $DIR/fixable.rs:129 :5
124
+ --> $DIR/fixable.rs:136 :5
125
125
|
126
126
LL | / if x && y {
127
127
LL | | return false;
@@ -131,33 +131,33 @@ LL | | };
131
131
| |_____^ help: you can reduce it to: `return !(x && y)`
132
132
133
133
error: equality checks against true are unnecessary
134
- --> $DIR/fixable.rs:137 :8
134
+ --> $DIR/fixable.rs:144 :8
135
135
|
136
136
LL | if x == true {};
137
137
| ^^^^^^^^^ help: try simplifying it as shown: `x`
138
138
|
139
139
= note: `-D clippy::bool-comparison` implied by `-D warnings`
140
140
141
141
error: equality checks against false can be replaced by a negation
142
- --> $DIR/fixable.rs:141 :8
142
+ --> $DIR/fixable.rs:148 :8
143
143
|
144
144
LL | if x == false {};
145
145
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
146
146
147
147
error: equality checks against true are unnecessary
148
- --> $DIR/fixable.rs:151 :8
148
+ --> $DIR/fixable.rs:158 :8
149
149
|
150
150
LL | if x == true {};
151
151
| ^^^^^^^^^ help: try simplifying it as shown: `x`
152
152
153
153
error: equality checks against false can be replaced by a negation
154
- --> $DIR/fixable.rs:152 :8
154
+ --> $DIR/fixable.rs:159 :8
155
155
|
156
156
LL | if x == false {};
157
157
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
158
158
159
159
error: this if-then-else expression returns a bool literal
160
- --> $DIR/fixable.rs:161 :12
160
+ --> $DIR/fixable.rs:168 :12
161
161
|
162
162
LL | } else if returns_bool() {
163
163
| ____________^
@@ -168,7 +168,7 @@ LL | | };
168
168
| |_____^ help: you can reduce it to: `{ !returns_bool() }`
169
169
170
170
error: this if-then-else expression returns a bool literal
171
- --> $DIR/fixable.rs:174 :5
171
+ --> $DIR/fixable.rs:181 :5
172
172
|
173
173
LL | / if unsafe { no(4) } & 1 != 0 {
174
174
LL | | true
@@ -178,13 +178,13 @@ LL | | };
178
178
| |_____^ help: you can reduce it to: `(unsafe { no(4) } & 1 != 0)`
179
179
180
180
error: this if-then-else expression returns a bool literal
181
- --> $DIR/fixable.rs:179 :30
181
+ --> $DIR/fixable.rs:186 :30
182
182
|
183
183
LL | let _brackets_unneeded = if unsafe { no(4) } & 1 != 0 { true } else { false };
184
184
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `unsafe { no(4) } & 1 != 0`
185
185
186
186
error: this if-then-else expression returns a bool literal
187
- --> $DIR/fixable.rs:182 :9
187
+ --> $DIR/fixable.rs:189 :9
188
188
|
189
189
LL | if unsafe { no(4) } & 1 != 0 { true } else { false }
190
190
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `(unsafe { no(4) } & 1 != 0)`
0 commit comments