@@ -31,7 +31,67 @@ LL | | };
31
31
| |_____^ help: you can reduce it to: `!(x && y)`
32
32
33
33
error: this if-then-else expression returns a bool literal
34
- --> $DIR/fixable.rs:72:5
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
35
95
|
36
96
LL | / if x {
37
97
LL | | return true;
@@ -41,7 +101,7 @@ LL | | };
41
101
| |_____^ help: you can reduce it to: `return x`
42
102
43
103
error: this if-then-else expression returns a bool literal
44
- --> $DIR/fixable.rs:80 :5
104
+ --> $DIR/fixable.rs:113 :5
45
105
|
46
106
LL | / if x {
47
107
LL | | return false;
@@ -51,7 +111,7 @@ LL | | };
51
111
| |_____^ help: you can reduce it to: `return !x`
52
112
53
113
error: this if-then-else expression returns a bool literal
54
- --> $DIR/fixable.rs:88 :5
114
+ --> $DIR/fixable.rs:121 :5
55
115
|
56
116
LL | / if x && y {
57
117
LL | | return true;
@@ -61,7 +121,7 @@ LL | | };
61
121
| |_____^ help: you can reduce it to: `return x && y`
62
122
63
123
error: this if-then-else expression returns a bool literal
64
- --> $DIR/fixable.rs:96 :5
124
+ --> $DIR/fixable.rs:129 :5
65
125
|
66
126
LL | / if x && y {
67
127
LL | | return false;
@@ -71,33 +131,33 @@ LL | | };
71
131
| |_____^ help: you can reduce it to: `return !(x && y)`
72
132
73
133
error: equality checks against true are unnecessary
74
- --> $DIR/fixable.rs:104 :8
134
+ --> $DIR/fixable.rs:137 :8
75
135
|
76
136
LL | if x == true {};
77
137
| ^^^^^^^^^ help: try simplifying it as shown: `x`
78
138
|
79
139
= note: `-D clippy::bool-comparison` implied by `-D warnings`
80
140
81
141
error: equality checks against false can be replaced by a negation
82
- --> $DIR/fixable.rs:108 :8
142
+ --> $DIR/fixable.rs:141 :8
83
143
|
84
144
LL | if x == false {};
85
145
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
86
146
87
147
error: equality checks against true are unnecessary
88
- --> $DIR/fixable.rs:118 :8
148
+ --> $DIR/fixable.rs:151 :8
89
149
|
90
150
LL | if x == true {};
91
151
| ^^^^^^^^^ help: try simplifying it as shown: `x`
92
152
93
153
error: equality checks against false can be replaced by a negation
94
- --> $DIR/fixable.rs:119 :8
154
+ --> $DIR/fixable.rs:152 :8
95
155
|
96
156
LL | if x == false {};
97
157
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
98
158
99
159
error: this if-then-else expression returns a bool literal
100
- --> $DIR/fixable.rs:128 :12
160
+ --> $DIR/fixable.rs:161 :12
101
161
|
102
162
LL | } else if returns_bool() {
103
163
| ____________^
@@ -108,7 +168,7 @@ LL | | };
108
168
| |_____^ help: you can reduce it to: `{ !returns_bool() }`
109
169
110
170
error: this if-then-else expression returns a bool literal
111
- --> $DIR/fixable.rs:141 :5
171
+ --> $DIR/fixable.rs:174 :5
112
172
|
113
173
LL | / if unsafe { no(4) } & 1 != 0 {
114
174
LL | | true
@@ -118,16 +178,16 @@ LL | | };
118
178
| |_____^ help: you can reduce it to: `(unsafe { no(4) } & 1 != 0)`
119
179
120
180
error: this if-then-else expression returns a bool literal
121
- --> $DIR/fixable.rs:146 :30
181
+ --> $DIR/fixable.rs:179 :30
122
182
|
123
183
LL | let _brackets_unneeded = if unsafe { no(4) } & 1 != 0 { true } else { false };
124
184
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `unsafe { no(4) } & 1 != 0`
125
185
126
186
error: this if-then-else expression returns a bool literal
127
- --> $DIR/fixable.rs:149 :9
187
+ --> $DIR/fixable.rs:182 :9
128
188
|
129
189
LL | if unsafe { no(4) } & 1 != 0 { true } else { false }
130
190
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `(unsafe { no(4) } & 1 != 0)`
131
191
132
- error: aborting due to 15 previous errors
192
+ error: aborting due to 21 previous errors
133
193
0 commit comments