Skip to content

Commit 20ba476

Browse files
committed
wildcard_match_arm: expand lint scope.
We're not only working with Results.
1 parent 1b3c3d0 commit 20ba476

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

clippy_lints/src/matches.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -464,17 +464,14 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) {
464464
}
465465

466466
fn check_wild_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) {
467-
let ex_ty = walk_ptrs_ty(cx.tables.expr_ty(ex));
468-
if match_type(cx, ex_ty, &paths::RESULT) {
469-
for arm in arms {
470-
if is_wild(&arm.pats[0]) {
471-
span_note_and_lint(cx,
472-
WILDCARD_MATCH_ARM,
473-
arm.pats[0].span,
474-
"wildcard match will miss any future added variants.",
475-
arm.pats[0].span,
476-
"to resolve, match each variant explicitly");
477-
}
467+
for arm in arms {
468+
if is_wild(&arm.pats[0]) {
469+
span_note_and_lint(cx,
470+
WILDCARD_MATCH_ARM,
471+
arm.pats[0].span,
472+
"wildcard match will miss any future added variants.",
473+
arm.pats[0].span,
474+
"to resolve, match each variant explicitly");
478475
}
479476
}
480477
}

0 commit comments

Comments
 (0)