about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-01-06 21:08:56 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-01-06 21:08:56 +0000
commitb693365b846b13c1da6c5158cc7f4598a1aaa2e4 (patch)
treec37334581724400e5b2eb4e0a5c0577faa596bdf
parent2631a5df6135b8cf877fa2464fe428a6bc704048 (diff)
downloadrust-b693365b846b13c1da6c5158cc7f4598a1aaa2e4.tar.gz
rust-b693365b846b13c1da6c5158cc7f4598a1aaa2e4.zip
fix rebase
-rw-r--r--compiler/rustc_hir_typeck/src/method/suggest.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs
index bcdb557be21..536c4270659 100644
--- a/compiler/rustc_hir_typeck/src/method/suggest.rs
+++ b/compiler/rustc_hir_typeck/src/method/suggest.rs
@@ -214,13 +214,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         }
                         if let hir::ExprKind::Path(hir::QPath::Resolved(None, path)) = kind
                             && let hir::def::Res::Local(hir_id) = path.res
-                            && let Some(hir::Node::Pat(binding)) = self.tcx.hir().find(hir_id)
-                            && let parent_hir_id = self.tcx.hir().get_parent_node(binding.hir_id)
-                            && let Some(hir::Node::Param(param)) = self.tcx.hir().find(parent_hir_id)
-                            && let parent_hir_id = self.tcx.hir().get_parent_node(param.hir_id)
-                            && let Some(node) = self.tcx.hir().find(parent_hir_id)
+                            && let Some(hir::Node::Pat(b)) = self.tcx.hir().find(hir_id)
+                            && let Some(hir::Node::Param(p)) = self.tcx.hir().find_parent(b.hir_id)
+                            && let Some(node) = self.tcx.hir().find_parent(p.hir_id)
                             && let Some(decl) = node.fn_decl()
-                            && let Some(ty) = decl.inputs.iter().find(|ty| ty.span == param.ty_span)
+                            && let Some(ty) = decl.inputs.iter().find(|ty| ty.span == p.ty_span)
                             && let hir::TyKind::Ref(_, mut_ty) = &ty.kind
                             && let hir::Mutability::Not = mut_ty.mutbl
                         {