11error: boolean expression will never evaluate to 'true'
2- --> $DIR/const_comparisons.rs:44 :5
2+ --> $DIR/const_comparisons.rs:45 :5
33 |
44LL | status_code <= 400 && status_code > 500;
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,216 +8,216 @@ LL | status_code <= 400 && status_code > 500;
88 = note: `-D clippy::impossible-comparisons` implied by `-D warnings`
99
1010error: boolean expression will never evaluate to 'true'
11- --> $DIR/const_comparisons.rs:47 :5
11+ --> $DIR/const_comparisons.rs:48 :5
1212 |
1313LL | status_code > 500 && status_code < 400;
1414 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1515 |
1616 = note: since `500` > `400`, the expression evaluates to false for any value of `status_code`
1717
1818error: boolean expression will never evaluate to 'true'
19- --> $DIR/const_comparisons.rs:50 :5
19+ --> $DIR/const_comparisons.rs:51 :5
2020 |
2121LL | status_code < 500 && status_code > 500;
2222 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2323 |
2424 = note: `status_code` cannot simultaneously be greater than and less than `500`
2525
2626error: boolean expression will never evaluate to 'true'
27- --> $DIR/const_comparisons.rs:55 :5
27+ --> $DIR/const_comparisons.rs:56 :5
2828 |
2929LL | status_code < { 400 } && status_code > { 500 };
3030 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3131 |
3232 = note: since `{ 400 }` < `{ 500 }`, the expression evaluates to false for any value of `status_code`
3333
3434error: boolean expression will never evaluate to 'true'
35- --> $DIR/const_comparisons.rs:58 :5
35+ --> $DIR/const_comparisons.rs:59 :5
3636 |
3737LL | status_code < STATUS_BAD_REQUEST && status_code > STATUS_SERVER_ERROR;
3838 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3939 |
4040 = note: since `STATUS_BAD_REQUEST` < `STATUS_SERVER_ERROR`, the expression evaluates to false for any value of `status_code`
4141
4242error: boolean expression will never evaluate to 'true'
43- --> $DIR/const_comparisons.rs:61 :5
43+ --> $DIR/const_comparisons.rs:62 :5
4444 |
4545LL | status_code <= u16::MIN + 1 && status_code > STATUS_SERVER_ERROR;
4646 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4747 |
4848 = note: since `u16::MIN + 1` < `STATUS_SERVER_ERROR`, the expression evaluates to false for any value of `status_code`
4949
5050error: boolean expression will never evaluate to 'true'
51- --> $DIR/const_comparisons.rs:64 :5
51+ --> $DIR/const_comparisons.rs:65 :5
5252 |
5353LL | status_code < STATUS_SERVER_ERROR && status_code > STATUS_SERVER_ERROR;
5454 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5555 |
5656 = note: `status_code` cannot simultaneously be greater than and less than `STATUS_SERVER_ERROR`
5757
5858error: boolean expression will never evaluate to 'true'
59- --> $DIR/const_comparisons.rs:69 :5
59+ --> $DIR/const_comparisons.rs:70 :5
6060 |
6161LL | status < { 400 } && status > { 500 };
6262 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6363 |
6464 = note: since `{ 400 }` < `{ 500 }`, the expression evaluates to false for any value of `status`
6565
6666error: boolean expression will never evaluate to 'true'
67- --> $DIR/const_comparisons.rs:72 :5
67+ --> $DIR/const_comparisons.rs:73 :5
6868 |
6969LL | status < STATUS_BAD_REQUEST && status > STATUS_SERVER_ERROR;
7070 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7171 |
7272 = note: since `STATUS_BAD_REQUEST` < `STATUS_SERVER_ERROR`, the expression evaluates to false for any value of `status`
7373
7474error: boolean expression will never evaluate to 'true'
75- --> $DIR/const_comparisons.rs:75 :5
75+ --> $DIR/const_comparisons.rs:76 :5
7676 |
7777LL | status <= u16::MIN + 1 && status > STATUS_SERVER_ERROR;
7878 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7979 |
8080 = note: since `u16::MIN + 1` < `STATUS_SERVER_ERROR`, the expression evaluates to false for any value of `status`
8181
8282error: boolean expression will never evaluate to 'true'
83- --> $DIR/const_comparisons.rs:78 :5
83+ --> $DIR/const_comparisons.rs:79 :5
8484 |
8585LL | status < STATUS_SERVER_ERROR && status > STATUS_SERVER_ERROR;
8686 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8787 |
8888 = note: `status` cannot simultaneously be greater than and less than `STATUS_SERVER_ERROR`
8989
9090error: boolean expression will never evaluate to 'true'
91- --> $DIR/const_comparisons.rs:85 :5
91+ --> $DIR/const_comparisons.rs:89 :5
9292 |
93- LL | 500 >= status_code && 600 < status_code; // Incorrect
93+ LL | 500 >= status_code && 600 < status_code;
9494 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9595 |
9696 = note: since `500` < `600`, the expression evaluates to false for any value of `status_code`
9797
9898error: boolean expression will never evaluate to 'true'
99- --> $DIR/const_comparisons.rs:88 :5
99+ --> $DIR/const_comparisons.rs:93 :5
100100 |
101- LL | 500 >= status_code && status_code > 600; // Incorrect
101+ LL | 500 >= status_code && status_code > 600;
102102 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103103 |
104104 = note: since `500` < `600`, the expression evaluates to false for any value of `status_code`
105105
106106error: boolean expression will never evaluate to 'true'
107- --> $DIR/const_comparisons.rs:95 :5
107+ --> $DIR/const_comparisons.rs:103 :5
108108 |
109- LL | 500 >= status && 600 < status; // Incorrect
109+ LL | 500 >= status && 600 < status;
110110 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111111 |
112112 = note: since `500` < `600`, the expression evaluates to false for any value of `status`
113113
114114error: boolean expression will never evaluate to 'true'
115- --> $DIR/const_comparisons.rs:98 :5
115+ --> $DIR/const_comparisons.rs:107 :5
116116 |
117- LL | 500 >= status && status > 600; // Incorrect
117+ LL | 500 >= status && status > 600;
118118 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119119 |
120120 = note: since `500` < `600`, the expression evaluates to false for any value of `status`
121121
122122error: right-hand side of `&&` operator has no effect
123- --> $DIR/const_comparisons.rs:103 :5
123+ --> $DIR/const_comparisons.rs:112 :5
124124 |
125125LL | status_code < 200 && status_code <= 299;
126126 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127127 |
128128note: `if `status_code < 200` evaluates to true, status_code <= 299` will always evaluate to true as well
129- --> $DIR/const_comparisons.rs:103 :23
129+ --> $DIR/const_comparisons.rs:112 :23
130130 |
131131LL | status_code < 200 && status_code <= 299;
132132 | ^^^^^^^^^^^^^^^^^^^^^
133133 = note: `-D clippy::redundant-comparisons` implied by `-D warnings`
134134
135135error: left-hand side of `&&` operator has no effect
136- --> $DIR/const_comparisons.rs:105 :5
136+ --> $DIR/const_comparisons.rs:114 :5
137137 |
138138LL | status_code > 200 && status_code >= 299;
139139 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140140 |
141141note: `if `status_code >= 299` evaluates to true, status_code > 200` will always evaluate to true as well
142- --> $DIR/const_comparisons.rs:105 :5
142+ --> $DIR/const_comparisons.rs:114 :5
143143 |
144144LL | status_code > 200 && status_code >= 299;
145145 | ^^^^^^^^^^^^^^^^^^^^^
146146
147147error: left-hand side of `&&` operator has no effect
148- --> $DIR/const_comparisons.rs:108 :5
148+ --> $DIR/const_comparisons.rs:118 :5
149149 |
150- LL | status_code >= 500 && status_code > 500; // Useless left
150+ LL | status_code >= 500 && status_code > 500;
151151 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152152 |
153153note: `if `status_code > 500` evaluates to true, status_code >= 500` will always evaluate to true as well
154- --> $DIR/const_comparisons.rs:108 :5
154+ --> $DIR/const_comparisons.rs:118 :5
155155 |
156- LL | status_code >= 500 && status_code > 500; // Useless left
156+ LL | status_code >= 500 && status_code > 500;
157157 | ^^^^^^^^^^^^^^^^^^^^^^
158158
159159error: right-hand side of `&&` operator has no effect
160- --> $DIR/const_comparisons.rs:110 :5
160+ --> $DIR/const_comparisons.rs:121 :5
161161 |
162- LL | status_code > 500 && status_code >= 500; // Useless right
162+ LL | status_code > 500 && status_code >= 500;
163163 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
164164 |
165165note: `if `status_code > 500` evaluates to true, status_code >= 500` will always evaluate to true as well
166- --> $DIR/const_comparisons.rs:110 :23
166+ --> $DIR/const_comparisons.rs:121 :23
167167 |
168- LL | status_code > 500 && status_code >= 500; // Useless right
168+ LL | status_code > 500 && status_code >= 500;
169169 | ^^^^^^^^^^^^^^^^^^^^^
170170
171171error: left-hand side of `&&` operator has no effect
172- --> $DIR/const_comparisons.rs:112 :5
172+ --> $DIR/const_comparisons.rs:124 :5
173173 |
174- LL | status_code <= 500 && status_code < 500; // Useless left
174+ LL | status_code <= 500 && status_code < 500;
175175 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176176 |
177177note: `if `status_code < 500` evaluates to true, status_code <= 500` will always evaluate to true as well
178- --> $DIR/const_comparisons.rs:112 :5
178+ --> $DIR/const_comparisons.rs:124 :5
179179 |
180- LL | status_code <= 500 && status_code < 500; // Useless left
180+ LL | status_code <= 500 && status_code < 500;
181181 | ^^^^^^^^^^^^^^^^^^^^^^
182182
183183error: right-hand side of `&&` operator has no effect
184- --> $DIR/const_comparisons.rs:114 :5
184+ --> $DIR/const_comparisons.rs:127 :5
185185 |
186- LL | status_code < 500 && status_code <= 500; // Useless right
186+ LL | status_code < 500 && status_code <= 500;
187187 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188188 |
189189note: `if `status_code < 500` evaluates to true, status_code <= 500` will always evaluate to true as well
190- --> $DIR/const_comparisons.rs:114 :23
190+ --> $DIR/const_comparisons.rs:127 :23
191191 |
192- LL | status_code < 500 && status_code <= 500; // Useless right
192+ LL | status_code < 500 && status_code <= 500;
193193 | ^^^^^^^^^^^^^^^^^^^^^
194194
195195error: boolean expression will never evaluate to 'true'
196- --> $DIR/const_comparisons.rs:119 :5
196+ --> $DIR/const_comparisons.rs:132 :5
197197 |
198198LL | name < "Jennifer" && name > "Shannon";
199199 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200200 |
201201 = note: since `"Jennifer"` < `"Shannon"`, the expression evaluates to false for any value of `name`
202202
203203error: boolean expression will never evaluate to 'true'
204- --> $DIR/const_comparisons.rs:124 :5
204+ --> $DIR/const_comparisons.rs:137 :5
205205 |
206206LL | numbers < [3, 4] && numbers > [5, 6];
207207 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
208208 |
209209 = note: since `[3, 4]` < `[5, 6]`, the expression evaluates to false for any value of `numbers`
210210
211211error: boolean expression will never evaluate to 'true'
212- --> $DIR/const_comparisons.rs:129 :5
212+ --> $DIR/const_comparisons.rs:142 :5
213213 |
214214LL | letter < 'b' && letter > 'c';
215215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
216216 |
217217 = note: since `'b'` < `'c'`, the expression evaluates to false for any value of `letter`
218218
219219error: boolean expression will never evaluate to 'true'
220- --> $DIR/const_comparisons.rs:134 :5
220+ --> $DIR/const_comparisons.rs:147 :5
221221 |
222222LL | area < std::f32::consts::E && area > std::f32::consts::PI;
223223 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments