1
1
error: boolean expression will never evaluate to 'true'
2
- --> $DIR/double_const_comparisons.rs:15 :5
2
+ --> $DIR/double_const_comparisons.rs:44 :5
3
3
|
4
4
LL | status_code <= 400 && status_code > 500;
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,173 +8,221 @@ LL | status_code <= 400 && status_code > 500;
8
8
= note: `-D clippy::impossible-double-const-comparisons` implied by `-D warnings`
9
9
10
10
error: boolean expression will never evaluate to 'true'
11
- --> $DIR/double_const_comparisons.rs:16 :5
11
+ --> $DIR/double_const_comparisons.rs:45 :5
12
12
|
13
13
LL | status_code > 500 && status_code < 400;
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15
15
|
16
16
= note: since `500` > `400`, the expression evaluates to false for any value of `status_code`
17
17
18
18
error: boolean expression will never evaluate to 'true'
19
- --> $DIR/double_const_comparisons.rs:17 :5
19
+ --> $DIR/double_const_comparisons.rs:46 :5
20
20
|
21
21
LL | status_code < 500 && status_code > 500;
22
22
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23
23
|
24
24
= note: `status_code` cannot simultaneously be greater than and less than `500`
25
25
26
26
error: boolean expression will never evaluate to 'true'
27
- --> $DIR/double_const_comparisons.rs:20 :5
27
+ --> $DIR/double_const_comparisons.rs:49 :5
28
28
|
29
29
LL | status_code < { 400 } && status_code > { 500 };
30
30
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31
31
|
32
32
= note: since `{ 400 }` < `{ 500 }`, the expression evaluates to false for any value of `status_code`
33
33
34
34
error: boolean expression will never evaluate to 'true'
35
- --> $DIR/double_const_comparisons.rs:21 :5
35
+ --> $DIR/double_const_comparisons.rs:50 :5
36
36
|
37
37
LL | status_code < STATUS_BAD_REQUEST && status_code > STATUS_SERVER_ERROR;
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
39
|
40
40
= note: since `STATUS_BAD_REQUEST` < `STATUS_SERVER_ERROR`, the expression evaluates to false for any value of `status_code`
41
41
42
42
error: boolean expression will never evaluate to 'true'
43
- --> $DIR/double_const_comparisons.rs:22 :5
43
+ --> $DIR/double_const_comparisons.rs:51 :5
44
44
|
45
45
LL | status_code <= u16::MIN + 1 && status_code > STATUS_SERVER_ERROR;
46
46
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47
47
|
48
48
= note: since `u16::MIN + 1` < `STATUS_SERVER_ERROR`, the expression evaluates to false for any value of `status_code`
49
49
50
50
error: boolean expression will never evaluate to 'true'
51
- --> $DIR/double_const_comparisons.rs:23 :5
51
+ --> $DIR/double_const_comparisons.rs:52 :5
52
52
|
53
53
LL | status_code < STATUS_SERVER_ERROR && status_code > STATUS_SERVER_ERROR;
54
54
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55
55
|
56
56
= note: `status_code` cannot simultaneously be greater than and less than `STATUS_SERVER_ERROR`
57
57
58
58
error: 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
60
92
|
61
93
LL | 500 >= status_code && 600 < status_code; // Incorrect
62
94
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63
95
|
64
96
= note: since `500` < `600`, the expression evaluates to false for any value of `status_code`
65
97
66
98
error: boolean expression will never evaluate to 'true'
67
- --> $DIR/double_const_comparisons.rs:29 :5
99
+ --> $DIR/double_const_comparisons.rs:64 :5
68
100
|
69
101
LL | 500 >= status_code && status_code > 600; // Incorrect
70
102
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71
103
|
72
104
= note: since `500` < `600`, the expression evaluates to false for any value of `status_code`
73
105
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
+
74
122
error: right-hand side of `&&` operator has no effect
75
- --> $DIR/double_const_comparisons.rs:32 :5
123
+ --> $DIR/double_const_comparisons.rs:73 :5
76
124
|
77
125
LL | status_code < 200 && status_code <= 299;
78
126
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79
127
|
80
128
note: `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
82
130
|
83
131
LL | status_code < 200 && status_code <= 299;
84
132
| ^^^^^^^^^^^^^^^^^^^^^
85
133
= note: `-D clippy::ineffective-double-const-comparisons` implied by `-D warnings`
86
134
87
135
error: left-hand side of `&&` operator has no effect
88
- --> $DIR/double_const_comparisons.rs:33 :5
136
+ --> $DIR/double_const_comparisons.rs:74 :5
89
137
|
90
138
LL | status_code > 200 && status_code >= 299;
91
139
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92
140
|
93
141
note: `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
95
143
|
96
144
LL | status_code > 200 && status_code >= 299;
97
145
| ^^^^^^^^^^^^^^^^^^^^^
98
146
99
147
error: left-hand side of `&&` operator has no effect
100
- --> $DIR/double_const_comparisons.rs:35 :5
148
+ --> $DIR/double_const_comparisons.rs:76 :5
101
149
|
102
150
LL | status_code >= 500 && status_code > 500; // Useless left
103
151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
152
|
105
153
note: `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
107
155
|
108
156
LL | status_code >= 500 && status_code > 500; // Useless left
109
157
| ^^^^^^^^^^^^^^^^^^^^^^
110
158
111
159
error: right-hand side of `&&` operator has no effect
112
- --> $DIR/double_const_comparisons.rs:36 :5
160
+ --> $DIR/double_const_comparisons.rs:77 :5
113
161
|
114
162
LL | status_code > 500 && status_code >= 500; // Useless right
115
163
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
116
164
|
117
165
note: `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
119
167
|
120
168
LL | status_code > 500 && status_code >= 500; // Useless right
121
169
| ^^^^^^^^^^^^^^^^^^^^^
122
170
123
171
error: left-hand side of `&&` operator has no effect
124
- --> $DIR/double_const_comparisons.rs:37 :5
172
+ --> $DIR/double_const_comparisons.rs:78 :5
125
173
|
126
174
LL | status_code <= 500 && status_code < 500; // Useless left
127
175
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
176
|
129
177
note: `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
131
179
|
132
180
LL | status_code <= 500 && status_code < 500; // Useless left
133
181
| ^^^^^^^^^^^^^^^^^^^^^^
134
182
135
183
error: right-hand side of `&&` operator has no effect
136
- --> $DIR/double_const_comparisons.rs:38 :5
184
+ --> $DIR/double_const_comparisons.rs:79 :5
137
185
|
138
186
LL | status_code < 500 && status_code <= 500; // Useless right
139
187
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140
188
|
141
189
note: `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
143
191
|
144
192
LL | status_code < 500 && status_code <= 500; // Useless right
145
193
| ^^^^^^^^^^^^^^^^^^^^^
146
194
147
195
error: boolean expression will never evaluate to 'true'
148
- --> $DIR/double_const_comparisons.rs:42 :5
196
+ --> $DIR/double_const_comparisons.rs:83 :5
149
197
|
150
198
LL | name < "Jennifer" && name > "Shannon";
151
199
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152
200
|
153
201
= note: since `"Jennifer"` < `"Shannon"`, the expression evaluates to false for any value of `name`
154
202
155
203
error: boolean expression will never evaluate to 'true'
156
- --> $DIR/double_const_comparisons.rs:45 :5
204
+ --> $DIR/double_const_comparisons.rs:86 :5
157
205
|
158
206
LL | numbers < [3, 4] && numbers > [5, 6];
159
207
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160
208
|
161
209
= note: since `[3, 4]` < `[5, 6]`, the expression evaluates to false for any value of `numbers`
162
210
163
211
error: boolean expression will never evaluate to 'true'
164
- --> $DIR/double_const_comparisons.rs:48 :5
212
+ --> $DIR/double_const_comparisons.rs:89 :5
165
213
|
166
214
LL | letter < 'b' && letter > 'c';
167
215
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168
216
|
169
217
= note: since `'b'` < `'c'`, the expression evaluates to false for any value of `letter`
170
218
171
219
error: boolean expression will never evaluate to 'true'
172
- --> $DIR/double_const_comparisons.rs:51 :5
220
+ --> $DIR/double_const_comparisons.rs:92 :5
173
221
|
174
222
LL | area < std::f32::consts::E && area > std::f32::consts::PI;
175
223
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176
224
|
177
225
= note: since `std::f32::consts::E` < `std::f32::consts::PI`, the expression evaluates to false for any value of `area`
178
226
179
- error: aborting due to 19 previous errors
227
+ error: aborting due to 25 previous errors
180
228
0 commit comments