1
1
error: redundant guard
2
- --> tests/ui/redundant_guards.rs:34:20
2
+ --> tests/ui/redundant_guards.rs:22:14
3
3
|
4
- LL | C(x, y) if let 1 = y => .. ,
5
- | ^ ^^^^^^^^
4
+ LL | x if x == 0.0 => todo!() ,
5
+ | ^^^^^^^^
6
6
|
7
7
= note: `-D clippy::redundant-guards` implied by `-D warnings`
8
8
= help: to override `-D warnings` add `#[allow(clippy::redundant_guards)]`
9
9
help: try
10
10
|
11
+ LL - x if x == 0.0 => todo!(),
12
+ LL + 0.0 => todo!(),
13
+ |
14
+
15
+ error: redundant guard
16
+ --> tests/ui/redundant_guards.rs:28:14
17
+ |
18
+ LL | x if x == FloatWrapper(0.0) => todo!(),
19
+ | ^^^^^^^^^^^^^^^^^^^^^^
20
+ |
21
+ help: try
22
+ |
23
+ LL - x if x == FloatWrapper(0.0) => todo!(),
24
+ LL + FloatWrapper(0.0) => todo!(),
25
+ |
26
+
27
+ error: redundant guard
28
+ --> tests/ui/redundant_guards.rs:43:20
29
+ |
30
+ LL | C(x, y) if let 1 = y => ..,
31
+ | ^^^^^^^^^
32
+ |
33
+ help: try
34
+ |
11
35
LL - C(x, y) if let 1 = y => ..,
12
36
LL + C(x, 1) => ..,
13
37
|
14
38
15
39
error: redundant guard
16
- --> tests/ui/redundant_guards.rs:40 :20
40
+ --> tests/ui/redundant_guards.rs:49 :20
17
41
|
18
42
LL | Some(x) if matches!(x, Some(1) if true) => ..,
19
43
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -24,7 +48,7 @@ LL | Some(Some(1)) if true => ..,
24
48
| ~~~~~~~ ~~~~~~~
25
49
26
50
error: redundant guard
27
- --> tests/ui/redundant_guards.rs:41 :20
51
+ --> tests/ui/redundant_guards.rs:50 :20
28
52
|
29
53
LL | Some(x) if matches!(x, Some(1)) => {
30
54
| ^^^^^^^^^^^^^^^^^^^^
@@ -36,7 +60,7 @@ LL + Some(Some(1)) => {
36
60
|
37
61
38
62
error: redundant guard
39
- --> tests/ui/redundant_guards.rs:45 :20
63
+ --> tests/ui/redundant_guards.rs:54 :20
40
64
|
41
65
LL | Some(x) if let Some(1) = x => ..,
42
66
| ^^^^^^^^^^^^^^^
@@ -48,7 +72,7 @@ LL + Some(Some(1)) => ..,
48
72
|
49
73
50
74
error: redundant guard
51
- --> tests/ui/redundant_guards.rs:46 :20
75
+ --> tests/ui/redundant_guards.rs:55 :20
52
76
|
53
77
LL | Some(x) if x == Some(2) => ..,
54
78
| ^^^^^^^^^^^^
@@ -60,7 +84,7 @@ LL + Some(Some(2)) => ..,
60
84
|
61
85
62
86
error: redundant guard
63
- --> tests/ui/redundant_guards.rs:47 :20
87
+ --> tests/ui/redundant_guards.rs:56 :20
64
88
|
65
89
LL | Some(x) if Some(2) == x => ..,
66
90
| ^^^^^^^^^^^^
@@ -72,7 +96,7 @@ LL + Some(Some(2)) => ..,
72
96
|
73
97
74
98
error: redundant guard
75
- --> tests/ui/redundant_guards.rs:72 :20
99
+ --> tests/ui/redundant_guards.rs:81 :20
76
100
|
77
101
LL | B { e } if matches!(e, Some(A(2))) => ..,
78
102
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,7 +108,7 @@ LL + B { e: Some(A(2)) } => ..,
84
108
|
85
109
86
110
error: redundant guard
87
- --> tests/ui/redundant_guards.rs:109 :20
111
+ --> tests/ui/redundant_guards.rs:118 :20
88
112
|
89
113
LL | E::A(y) if y == "not from an or pattern" => {},
90
114
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -96,7 +120,7 @@ LL + E::A("not from an or pattern") => {},
96
120
|
97
121
98
122
error: redundant guard
99
- --> tests/ui/redundant_guards.rs:116 :14
123
+ --> tests/ui/redundant_guards.rs:125 :14
100
124
|
101
125
LL | x if matches!(x, Some(0)) => ..,
102
126
| ^^^^^^^^^^^^^^^^^^^^
@@ -108,7 +132,7 @@ LL + Some(0) => ..,
108
132
|
109
133
110
134
error: redundant guard
111
- --> tests/ui/redundant_guards.rs:123 :14
135
+ --> tests/ui/redundant_guards.rs:132 :14
112
136
|
113
137
LL | i if i == -1 => {},
114
138
| ^^^^^^^
@@ -120,7 +144,7 @@ LL + -1 => {},
120
144
|
121
145
122
146
error: redundant guard
123
- --> tests/ui/redundant_guards.rs:124 :14
147
+ --> tests/ui/redundant_guards.rs:133 :14
124
148
|
125
149
LL | i if i == 1 => {},
126
150
| ^^^^^^
@@ -132,7 +156,7 @@ LL + 1 => {},
132
156
|
133
157
134
158
error: redundant guard
135
- --> tests/ui/redundant_guards.rs:186 :28
159
+ --> tests/ui/redundant_guards.rs:195 :28
136
160
|
137
161
LL | Some(ref x) if x == &1 => {},
138
162
| ^^^^^^^
@@ -144,7 +168,7 @@ LL + Some(1) => {},
144
168
|
145
169
146
170
error: redundant guard
147
- --> tests/ui/redundant_guards.rs:187 :28
171
+ --> tests/ui/redundant_guards.rs:196 :28
148
172
|
149
173
LL | Some(ref x) if &1 == x => {},
150
174
| ^^^^^^^
@@ -156,7 +180,7 @@ LL + Some(1) => {},
156
180
|
157
181
158
182
error: redundant guard
159
- --> tests/ui/redundant_guards.rs:188 :28
183
+ --> tests/ui/redundant_guards.rs:197 :28
160
184
|
161
185
LL | Some(ref x) if let &2 = x => {},
162
186
| ^^^^^^^^^^
@@ -168,7 +192,7 @@ LL + Some(2) => {},
168
192
|
169
193
170
194
error: redundant guard
171
- --> tests/ui/redundant_guards.rs:189 :28
195
+ --> tests/ui/redundant_guards.rs:198 :28
172
196
|
173
197
LL | Some(ref x) if matches!(x, &3) => {},
174
198
| ^^^^^^^^^^^^^^^
@@ -180,7 +204,7 @@ LL + Some(3) => {},
180
204
|
181
205
182
206
error: redundant guard
183
- --> tests/ui/redundant_guards.rs:209 :32
207
+ --> tests/ui/redundant_guards.rs:218 :32
184
208
|
185
209
LL | B { ref c, .. } if c == &1 => {},
186
210
| ^^^^^^^
@@ -192,7 +216,7 @@ LL + B { c: 1, .. } => {},
192
216
|
193
217
194
218
error: redundant guard
195
- --> tests/ui/redundant_guards.rs:210 :32
219
+ --> tests/ui/redundant_guards.rs:219 :32
196
220
|
197
221
LL | B { ref c, .. } if &1 == c => {},
198
222
| ^^^^^^^
@@ -204,7 +228,7 @@ LL + B { c: 1, .. } => {},
204
228
|
205
229
206
230
error: redundant guard
207
- --> tests/ui/redundant_guards.rs:211 :32
231
+ --> tests/ui/redundant_guards.rs:220 :32
208
232
|
209
233
LL | B { ref c, .. } if let &1 = c => {},
210
234
| ^^^^^^^^^^
@@ -216,7 +240,7 @@ LL + B { c: 1, .. } => {},
216
240
|
217
241
218
242
error: redundant guard
219
- --> tests/ui/redundant_guards.rs:212 :32
243
+ --> tests/ui/redundant_guards.rs:221 :32
220
244
|
221
245
LL | B { ref c, .. } if matches!(c, &1) => {},
222
246
| ^^^^^^^^^^^^^^^
@@ -228,7 +252,7 @@ LL + B { c: 1, .. } => {},
228
252
|
229
253
230
254
error: redundant guard
231
- --> tests/ui/redundant_guards.rs:222 :26
255
+ --> tests/ui/redundant_guards.rs:231 :26
232
256
|
233
257
LL | Some(Some(x)) if x.is_empty() => {},
234
258
| ^^^^^^^^^^^^
@@ -240,7 +264,7 @@ LL + Some(Some("")) => {},
240
264
|
241
265
242
266
error: redundant guard
243
- --> tests/ui/redundant_guards.rs:233 :26
267
+ --> tests/ui/redundant_guards.rs:242 :26
244
268
|
245
269
LL | Some(Some(x)) if x.is_empty() => {},
246
270
| ^^^^^^^^^^^^
@@ -252,7 +276,7 @@ LL + Some(Some([])) => {},
252
276
|
253
277
254
278
error: redundant guard
255
- --> tests/ui/redundant_guards.rs:238 :26
279
+ --> tests/ui/redundant_guards.rs:247 :26
256
280
|
257
281
LL | Some(Some(x)) if x.is_empty() => {},
258
282
| ^^^^^^^^^^^^
@@ -264,7 +288,7 @@ LL + Some(Some([])) => {},
264
288
|
265
289
266
290
error: redundant guard
267
- --> tests/ui/redundant_guards.rs:249 :26
291
+ --> tests/ui/redundant_guards.rs:258 :26
268
292
|
269
293
LL | Some(Some(x)) if x.starts_with(&[]) => {},
270
294
| ^^^^^^^^^^^^^^^^^^
@@ -276,7 +300,7 @@ LL + Some(Some([..])) => {},
276
300
|
277
301
278
302
error: redundant guard
279
- --> tests/ui/redundant_guards.rs:254 :26
303
+ --> tests/ui/redundant_guards.rs:263 :26
280
304
|
281
305
LL | Some(Some(x)) if x.starts_with(&[1]) => {},
282
306
| ^^^^^^^^^^^^^^^^^^^
@@ -288,7 +312,7 @@ LL + Some(Some([1, ..])) => {},
288
312
|
289
313
290
314
error: redundant guard
291
- --> tests/ui/redundant_guards.rs:259 :26
315
+ --> tests/ui/redundant_guards.rs:268 :26
292
316
|
293
317
LL | Some(Some(x)) if x.starts_with(&[1, 2]) => {},
294
318
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -300,7 +324,7 @@ LL + Some(Some([1, 2, ..])) => {},
300
324
|
301
325
302
326
error: redundant guard
303
- --> tests/ui/redundant_guards.rs:264 :26
327
+ --> tests/ui/redundant_guards.rs:273 :26
304
328
|
305
329
LL | Some(Some(x)) if x.ends_with(&[1, 2]) => {},
306
330
| ^^^^^^^^^^^^^^^^^^^^
@@ -312,7 +336,7 @@ LL + Some(Some([.., 1, 2])) => {},
312
336
|
313
337
314
338
error: redundant guard
315
- --> tests/ui/redundant_guards.rs:286 :18
339
+ --> tests/ui/redundant_guards.rs:295 :18
316
340
|
317
341
LL | y if y.is_empty() => {},
318
342
| ^^^^^^^^^^^^
@@ -324,7 +348,7 @@ LL + "" => {},
324
348
|
325
349
326
350
error: redundant guard
327
- --> tests/ui/redundant_guards.rs:305 :22
351
+ --> tests/ui/redundant_guards.rs:314 :22
328
352
|
329
353
LL | y if y.is_empty() => {},
330
354
| ^^^^^^^^^^^^
@@ -335,5 +359,5 @@ LL - y if y.is_empty() => {},
335
359
LL + "" => {},
336
360
|
337
361
338
- error: aborting due to 28 previous errors
362
+ error: aborting due to 30 previous errors
339
363
0 commit comments