]> git.lizzy.rs Git - rust.git/commitdiff
wildcard_match_arm: expand lint scope.
authorAlex Hamilton <alex.hamilton@ou.edu>
Fri, 25 Jan 2019 16:39:09 +0000 (10:39 -0600)
committerAlex Hamilton <alex.hamilton@ou.edu>
Tue, 29 Jan 2019 21:33:04 +0000 (15:33 -0600)
We're not only working with Results.

clippy_lints/src/matches.rs

index bdade6ee19e7fe6051c8031d3cb35bbf7c73317d..9d4279ad1bc3e4f207aac3e7e7c713fa98df76b9 100644 (file)
@@ -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");
         }
     }
 }