]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/non_expressive_names.rs
Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obk
[rust.git] / src / tools / clippy / clippy_lints / src / non_expressive_names.rs
index ac21eb5275f0f8bc443e0a88a903d0ac70e7e089..2ffc00b449d08b7e9c25282579618b98ee233912 100644 (file)
@@ -316,8 +316,11 @@ fn apply<F: for<'c> Fn(&'c mut Self)>(&mut self, f: F) {
 
 impl<'a, 'tcx> Visitor<'tcx> for SimilarNamesLocalVisitor<'a, 'tcx> {
     fn visit_local(&mut self, local: &'tcx Local) {
-        if let Some(ref init) = local.init {
-            self.apply(|this| walk_expr(this, &**init));
+        if let Some((init, els)) = &local.kind.init_else_opt() {
+            self.apply(|this| walk_expr(this, init));
+            if let Some(els) = els {
+                self.apply(|this| walk_block(this, els));
+            }
         }
         // add the pattern after the expression because the bindings aren't available
         // yet in the init