]> git.lizzy.rs Git - rust.git/commitdiff
fix rebase
authorEsteban Küber <esteban@kuber.com.ar>
Fri, 6 Jan 2023 21:08:56 +0000 (21:08 +0000)
committerEsteban Küber <esteban@kuber.com.ar>
Fri, 6 Jan 2023 21:08:56 +0000 (21:08 +0000)
compiler/rustc_hir_typeck/src/method/suggest.rs

index bcdb557be2176639a613cc36134e40cc642803ef..536c4270659582b17f32581b0f7488f405cb2381 100644 (file)
@@ -214,13 +214,11 @@ pub fn report_method_error(
                         }
                         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
                         {