]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/returns.rs
Fix dogfood
[rust.git] / clippy_lints / src / returns.rs
index e153288aa58df6dce17331634af31b7bf75a36e1..341b5a61631dff896fb93510799316fb6cb324a3 100644 (file)
@@ -206,13 +206,10 @@ fn check_final_expr<'tcx>(
         // an if/if let expr, check both exprs
         // note, if without else is going to be a type checking error anyways
         // (except for unit type functions) so we don't match it
-        ExprKind::Match(_, arms, source) => match source {
-            MatchSource::Normal => {
-                for arm in arms.iter() {
-                    check_final_expr(cx, arm.body, Some(arm.body.span), RetReplacement::Block);
-                }
-            },
-            _ => (),
+        ExprKind::Match(_, arms, MatchSource::Normal) => {
+            for arm in arms.iter() {
+                check_final_expr(cx, arm.body, Some(arm.body.span), RetReplacement::Block);
+            }
         },
         ExprKind::DropTemps(expr) => check_final_expr(cx, expr, None, RetReplacement::Empty),
         _ => (),
@@ -288,7 +285,7 @@ fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
                 .fn_sig(def_id)
                 .output()
                 .skip_binder()
-                .walk()
+                .walk(self.cx.tcx)
                 .any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(_)));
         }