Skip to content

Commit b693365

Browse files
committed
fix rebase
1 parent 2631a5d commit b693365

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

compiler/rustc_hir_typeck/src/method/suggest.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
214214
}
215215
if let hir::ExprKind::Path(hir::QPath::Resolved(None, path)) = kind
216216
&& let hir::def::Res::Local(hir_id) = path.res
217-
&& let Some(hir::Node::Pat(binding)) = self.tcx.hir().find(hir_id)
218-
&& let parent_hir_id = self.tcx.hir().get_parent_node(binding.hir_id)
219-
&& let Some(hir::Node::Param(param)) = self.tcx.hir().find(parent_hir_id)
220-
&& let parent_hir_id = self.tcx.hir().get_parent_node(param.hir_id)
221-
&& let Some(node) = self.tcx.hir().find(parent_hir_id)
217+
&& let Some(hir::Node::Pat(b)) = self.tcx.hir().find(hir_id)
218+
&& let Some(hir::Node::Param(p)) = self.tcx.hir().find_parent(b.hir_id)
219+
&& let Some(node) = self.tcx.hir().find_parent(p.hir_id)
222220
&& let Some(decl) = node.fn_decl()
223-
&& let Some(ty) = decl.inputs.iter().find(|ty| ty.span == param.ty_span)
221+
&& let Some(ty) = decl.inputs.iter().find(|ty| ty.span == p.ty_span)
224222
&& let hir::TyKind::Ref(_, mut_ty) = &ty.kind
225223
&& let hir::Mutability::Not = mut_ty.mutbl
226224
{

0 commit comments

Comments
 (0)