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