@@ -238,7 +238,7 @@ declare_clippy_lint! {
238
238
/// "bar" | _ => {},
239
239
/// }
240
240
/// ```
241
- pub PATS_WITH_WILD_MATCH_ARM ,
241
+ pub WILDCARD_IN_OR_PATTERNS ,
242
242
complexity,
243
243
"a wildcard pattern used with others patterns in same match arm"
244
244
}
@@ -252,7 +252,7 @@ declare_lint_pass!(Matches => [
252
252
MATCH_WILD_ERR_ARM ,
253
253
MATCH_AS_REF ,
254
254
WILDCARD_ENUM_MATCH_ARM ,
255
- PATS_WITH_WILD_MATCH_ARM
255
+ WILDCARD_IN_OR_PATTERNS
256
256
] ) ;
257
257
258
258
impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for Matches {
@@ -267,7 +267,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Matches {
267
267
check_wild_err_arm ( cx, ex, arms) ;
268
268
check_wild_enum_match ( cx, ex, arms) ;
269
269
check_match_as_ref ( cx, ex, arms, expr) ;
270
- check_pats_wild_match ( cx, ex, arms) ;
270
+ check_wild_in_or_pats ( cx, ex, arms) ;
271
271
}
272
272
if let ExprKind :: Match ( ref ex, ref arms, _) = expr. kind {
273
273
check_match_ref_pats ( cx, ex, arms, expr) ;
@@ -686,7 +686,7 @@ fn check_match_as_ref(cx: &LateContext<'_, '_>, ex: &Expr<'_>, arms: &[Arm<'_>],
686
686
}
687
687
}
688
688
689
- fn check_pats_wild_match ( cx : & LateContext < ' _ , ' _ > , ex : & Expr < ' _ > , arms : & [ Arm < ' _ > ] ) {
689
+ fn check_wild_in_or_pats ( cx : & LateContext < ' _ , ' _ > , ex : & Expr < ' _ > , arms : & [ Arm < ' _ > ] ) {
690
690
let mut is_non_exhaustive_enum = false ;
691
691
let ty = cx. tables . expr_ty ( ex) ;
692
692
if ty. is_enum ( ) {
@@ -703,7 +703,7 @@ fn check_pats_wild_match(cx: &LateContext<'_, '_>, ex: &Expr<'_>, arms: &[Arm<'_
703
703
if fields. len ( ) > 1 && fields. iter ( ) . any ( is_wild) {
704
704
span_lint_and_then (
705
705
cx,
706
- PATS_WITH_WILD_MATCH_ARM ,
706
+ WILDCARD_IN_OR_PATTERNS ,
707
707
arm. pat . span ,
708
708
"wildcard pattern covers any other pattern as it will match anyway." ,
709
709
|db| {
0 commit comments