]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/pat.rs
Rollup merge of #106499 - lyming2007:issue-105946-fix, r=estebank
[rust.git] / compiler / rustc_hir_typeck / src / pat.rs
index 1dff671b8c6be85eae5e22c6dddf12642f4c6c1f..e0304fa2d3b98b017f04ca6927c86e06d40639d7 100644 (file)
@@ -695,7 +695,7 @@ fn borrow_pat_suggestion(&self, err: &mut Diagnostic, pat: &Pat<'_>) {
         let tcx = self.tcx;
         if let PatKind::Ref(inner, mutbl) = pat.kind
         && let PatKind::Binding(_, _, binding, ..) = inner.kind {
-            let binding_parent_id = tcx.hir().get_parent_node(pat.hir_id);
+            let binding_parent_id = tcx.hir().parent_id(pat.hir_id);
             let binding_parent = tcx.hir().get(binding_parent_id);
             debug!(?inner, ?pat, ?binding_parent);
 
@@ -939,7 +939,7 @@ fn emit_bad_pat_path(
                         res.descr(),
                     ),
                 );
-                match self.tcx.hir().get(self.tcx.hir().get_parent_node(pat.hir_id)) {
+                match self.tcx.hir().get_parent(pat.hir_id) {
                     hir::Node::PatField(..) => {
                         e.span_suggestion_verbose(
                             ident.span.shrink_to_hi(),