File tree 1 file changed +13
-12
lines changed
1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -318,18 +318,6 @@ impl EarlyLintPass for MiscEarlyLints {
318
318
return ;
319
319
}
320
320
if wilds > 0 {
321
- let mut normal = vec ! [ ] ;
322
-
323
- for field in pfields {
324
- match field. pat . kind {
325
- PatKind :: Wild => { } ,
326
- _ => {
327
- if let Ok ( n) = cx. sess ( ) . source_map ( ) . span_to_snippet ( field. span ) {
328
- normal. push ( n) ;
329
- }
330
- } ,
331
- }
332
- }
333
321
for field in pfields {
334
322
if let PatKind :: Wild = field. pat . kind {
335
323
wilds -= 1 ;
@@ -341,6 +329,19 @@ impl EarlyLintPass for MiscEarlyLints {
341
329
"You matched a field with a wildcard pattern. Consider using `..` instead" ,
342
330
) ;
343
331
} else {
332
+ let mut normal = vec ! [ ] ;
333
+
334
+ for field in pfields {
335
+ match field. pat . kind {
336
+ PatKind :: Wild => { } ,
337
+ _ => {
338
+ if let Ok ( n) = cx. sess ( ) . source_map ( ) . span_to_snippet ( field. span ) {
339
+ normal. push ( n) ;
340
+ }
341
+ } ,
342
+ }
343
+ }
344
+
344
345
span_lint_and_help (
345
346
cx,
346
347
UNNEEDED_FIELD_PATTERN ,
You can’t perform that action at this time.
0 commit comments