11error: boolean expression will never evaluate to 'true'
2- --> $DIR/double_const_comparisons.rs:15 :5
2+ --> $DIR/double_const_comparisons.rs:44 :5
33 |
44LL | status_code <= 400 && status_code > 500;
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,173 +8,221 @@ LL | status_code <= 400 && status_code > 500;
88 = note: `-D clippy::impossible-double-const-comparisons` implied by `-D warnings`
99
1010error: boolean expression will never evaluate to 'true'
11- --> $DIR/double_const_comparisons.rs:16 :5
11+ --> $DIR/double_const_comparisons.rs:45 :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/double_const_comparisons.rs:17 :5
19+ --> $DIR/double_const_comparisons.rs:46 :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/double_const_comparisons.rs:20 :5
27+ --> $DIR/double_const_comparisons.rs:49 :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/double_const_comparisons.rs:21 :5
35+ --> $DIR/double_const_comparisons.rs:50 :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/double_const_comparisons.rs:22 :5
43+ --> $DIR/double_const_comparisons.rs:51 :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/double_const_comparisons.rs:23 :5
51+ --> $DIR/double_const_comparisons.rs:52 :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/double_const_comparisons.rs:28:5
59+ --> $DIR/double_const_comparisons.rs:55:5
60+ |
61+ LL | status < { 400 } && status > { 500 };
62+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63+ |
64+ = note: since `{ 400 }` < `{ 500 }`, the expression evaluates to false for any value of `status`
65+
66+ error: boolean expression will never evaluate to 'true'
67+ --> $DIR/double_const_comparisons.rs:56:5
68+ |
69+ LL | status < STATUS_BAD_REQUEST && status > STATUS_SERVER_ERROR;
70+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71+ |
72+ = note: since `STATUS_BAD_REQUEST` < `STATUS_SERVER_ERROR`, the expression evaluates to false for any value of `status`
73+
74+ error: boolean expression will never evaluate to 'true'
75+ --> $DIR/double_const_comparisons.rs:57:5
76+ |
77+ LL | status <= u16::MIN + 1 && status > STATUS_SERVER_ERROR;
78+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79+ |
80+ = note: since `u16::MIN + 1` < `STATUS_SERVER_ERROR`, the expression evaluates to false for any value of `status`
81+
82+ error: boolean expression will never evaluate to 'true'
83+ --> $DIR/double_const_comparisons.rs:58:5
84+ |
85+ LL | status < STATUS_SERVER_ERROR && status > STATUS_SERVER_ERROR;
86+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87+ |
88+ = note: `status` cannot simultaneously be greater than and less than `STATUS_SERVER_ERROR`
89+
90+ error: boolean expression will never evaluate to 'true'
91+ --> $DIR/double_const_comparisons.rs:63:5
6092 |
6193LL | 500 >= status_code && 600 < status_code; // Incorrect
6294 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6395 |
6496 = note: since `500` < `600`, the expression evaluates to false for any value of `status_code`
6597
6698error: boolean expression will never evaluate to 'true'
67- --> $DIR/double_const_comparisons.rs:29 :5
99+ --> $DIR/double_const_comparisons.rs:64 :5
68100 |
69101LL | 500 >= status_code && status_code > 600; // Incorrect
70102 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71103 |
72104 = note: since `500` < `600`, the expression evaluates to false for any value of `status_code`
73105
106+ error: boolean expression will never evaluate to 'true'
107+ --> $DIR/double_const_comparisons.rs:69:5
108+ |
109+ LL | 500 >= status && 600 < status; // Incorrect
110+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111+ |
112+ = note: since `500` < `600`, the expression evaluates to false for any value of `status`
113+
114+ error: boolean expression will never evaluate to 'true'
115+ --> $DIR/double_const_comparisons.rs:70:5
116+ |
117+ LL | 500 >= status && status > 600; // Incorrect
118+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119+ |
120+ = note: since `500` < `600`, the expression evaluates to false for any value of `status`
121+
74122error: right-hand side of `&&` operator has no effect
75- --> $DIR/double_const_comparisons.rs:32 :5
123+ --> $DIR/double_const_comparisons.rs:73 :5
76124 |
77125LL | status_code < 200 && status_code <= 299;
78126 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79127 |
80128note: `if `status_code < 200` evaluates to true, status_code <= 299` will always evaluate to true as well
81- --> $DIR/double_const_comparisons.rs:32 :23
129+ --> $DIR/double_const_comparisons.rs:73 :23
82130 |
83131LL | status_code < 200 && status_code <= 299;
84132 | ^^^^^^^^^^^^^^^^^^^^^
85133 = note: `-D clippy::ineffective-double-const-comparisons` implied by `-D warnings`
86134
87135error: left-hand side of `&&` operator has no effect
88- --> $DIR/double_const_comparisons.rs:33 :5
136+ --> $DIR/double_const_comparisons.rs:74 :5
89137 |
90138LL | status_code > 200 && status_code >= 299;
91139 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92140 |
93141note: `if `status_code >= 299` evaluates to true, status_code > 200` will always evaluate to true as well
94- --> $DIR/double_const_comparisons.rs:33 :5
142+ --> $DIR/double_const_comparisons.rs:74 :5
95143 |
96144LL | status_code > 200 && status_code >= 299;
97145 | ^^^^^^^^^^^^^^^^^^^^^
98146
99147error: left-hand side of `&&` operator has no effect
100- --> $DIR/double_const_comparisons.rs:35 :5
148+ --> $DIR/double_const_comparisons.rs:76 :5
101149 |
102150LL | status_code >= 500 && status_code > 500; // Useless left
103151 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104152 |
105153note: `if `status_code > 500` evaluates to true, status_code >= 500` will always evaluate to true as well
106- --> $DIR/double_const_comparisons.rs:35 :5
154+ --> $DIR/double_const_comparisons.rs:76 :5
107155 |
108156LL | status_code >= 500 && status_code > 500; // Useless left
109157 | ^^^^^^^^^^^^^^^^^^^^^^
110158
111159error: right-hand side of `&&` operator has no effect
112- --> $DIR/double_const_comparisons.rs:36 :5
160+ --> $DIR/double_const_comparisons.rs:77 :5
113161 |
114162LL | status_code > 500 && status_code >= 500; // Useless right
115163 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
116164 |
117165note: `if `status_code > 500` evaluates to true, status_code >= 500` will always evaluate to true as well
118- --> $DIR/double_const_comparisons.rs:36 :23
166+ --> $DIR/double_const_comparisons.rs:77 :23
119167 |
120168LL | status_code > 500 && status_code >= 500; // Useless right
121169 | ^^^^^^^^^^^^^^^^^^^^^
122170
123171error: left-hand side of `&&` operator has no effect
124- --> $DIR/double_const_comparisons.rs:37 :5
172+ --> $DIR/double_const_comparisons.rs:78 :5
125173 |
126174LL | status_code <= 500 && status_code < 500; // Useless left
127175 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128176 |
129177note: `if `status_code < 500` evaluates to true, status_code <= 500` will always evaluate to true as well
130- --> $DIR/double_const_comparisons.rs:37 :5
178+ --> $DIR/double_const_comparisons.rs:78 :5
131179 |
132180LL | status_code <= 500 && status_code < 500; // Useless left
133181 | ^^^^^^^^^^^^^^^^^^^^^^
134182
135183error: right-hand side of `&&` operator has no effect
136- --> $DIR/double_const_comparisons.rs:38 :5
184+ --> $DIR/double_const_comparisons.rs:79 :5
137185 |
138186LL | status_code < 500 && status_code <= 500; // Useless right
139187 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140188 |
141189note: `if `status_code < 500` evaluates to true, status_code <= 500` will always evaluate to true as well
142- --> $DIR/double_const_comparisons.rs:38 :23
190+ --> $DIR/double_const_comparisons.rs:79 :23
143191 |
144192LL | status_code < 500 && status_code <= 500; // Useless right
145193 | ^^^^^^^^^^^^^^^^^^^^^
146194
147195error: boolean expression will never evaluate to 'true'
148- --> $DIR/double_const_comparisons.rs:42 :5
196+ --> $DIR/double_const_comparisons.rs:83 :5
149197 |
150198LL | name < "Jennifer" && name > "Shannon";
151199 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152200 |
153201 = note: since `"Jennifer"` < `"Shannon"`, the expression evaluates to false for any value of `name`
154202
155203error: boolean expression will never evaluate to 'true'
156- --> $DIR/double_const_comparisons.rs:45 :5
204+ --> $DIR/double_const_comparisons.rs:86 :5
157205 |
158206LL | numbers < [3, 4] && numbers > [5, 6];
159207 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160208 |
161209 = note: since `[3, 4]` < `[5, 6]`, the expression evaluates to false for any value of `numbers`
162210
163211error: boolean expression will never evaluate to 'true'
164- --> $DIR/double_const_comparisons.rs:48 :5
212+ --> $DIR/double_const_comparisons.rs:89 :5
165213 |
166214LL | letter < 'b' && letter > 'c';
167215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168216 |
169217 = note: since `'b'` < `'c'`, the expression evaluates to false for any value of `letter`
170218
171219error: boolean expression will never evaluate to 'true'
172- --> $DIR/double_const_comparisons.rs:51 :5
220+ --> $DIR/double_const_comparisons.rs:92 :5
173221 |
174222LL | area < std::f32::consts::E && area > std::f32::consts::PI;
175223 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176224 |
177225 = note: since `std::f32::consts::E` < `std::f32::consts::PI`, the expression evaluates to false for any value of `area`
178226
179- error: aborting due to 19 previous errors
227+ error: aborting due to 25 previous errors
180228
0 commit comments