about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Hamilton <alex.hamilton@ou.edu>2019-01-25 10:39:09 -0600
committerAlex Hamilton <alex.hamilton@ou.edu>2019-01-29 15:33:04 -0600
commit20ba476ea85b0d01fc468c565770f1fb61132273 (patch)
tree0002943746948e5c2635ad54dc718464f3d8fe40
parent1b3c3d073af9a022b7cfb620d455d25415f7ddc4 (diff)
downloadrust-20ba476ea85b0d01fc468c565770f1fb61132273.tar.gz
rust-20ba476ea85b0d01fc468c565770f1fb61132273.zip
wildcard_match_arm: expand lint scope.
We're not only working with Results.
-rw-r--r--clippy_lints/src/matches.rs19
1 files changed, 8 insertions, 11 deletions
diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs
index bdade6ee19e..9d4279ad1bc 100644
--- a/clippy_lints/src/matches.rs
+++ b/clippy_lints/src/matches.rs
@@ -464,17 +464,14 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) {
 }
 
 fn check_wild_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) {
-    let ex_ty = walk_ptrs_ty(cx.tables.expr_ty(ex));
-    if match_type(cx, ex_ty, &paths::RESULT) {
-        for arm in arms {
-            if is_wild(&arm.pats[0]) {
-                span_note_and_lint(cx,
-                    WILDCARD_MATCH_ARM,
-                    arm.pats[0].span,
-                    "wildcard match will miss any future added variants.",
-                    arm.pats[0].span,
-                    "to resolve, match each variant explicitly");
-            }
+    for arm in arms {
+        if is_wild(&arm.pats[0]) {
+            span_note_and_lint(cx,
+                WILDCARD_MATCH_ARM,
+                arm.pats[0].span,
+                "wildcard match will miss any future added variants.",
+                arm.pats[0].span,
+                "to resolve, match each variant explicitly");
         }
     }
 }