]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_borrowck/borrowck/gather_loans/mod.rs
Rollup merge of #45097 - nivkner:fixme_fixup2, r=estebank
[rust.git] / src / librustc_borrowck / borrowck / gather_loans / mod.rs
index 6b52d842f8b196fadabdf889bf78f17548b04864..bb39e8ad2e6c223171a099222d7130d6e316a58c 100644 (file)
@@ -441,13 +441,13 @@ pub fn mark_loan_path_as_mutated(&self, loan_path: &LoanPath) {
             wrapped_path = match current_path.kind {
                 LpVar(local_id) => {
                     if !through_borrow {
-                        self.tcx().used_mut_nodes.borrow_mut().insert(local_id);
+                        let hir_id = self.bccx.tcx.hir.node_to_hir_id(local_id);
+                        self.bccx.used_mut_nodes.borrow_mut().insert(hir_id);
                     }
                     None
                 }
                 LpUpvar(ty::UpvarId{ var_id, closure_expr_id: _ }) => {
-                    let local_id = self.tcx().hir.hir_to_node_id(var_id);
-                    self.tcx().used_mut_nodes.borrow_mut().insert(local_id);
+                    self.bccx.used_mut_nodes.borrow_mut().insert(var_id);
                     None
                 }
                 LpExtend(ref base, mc::McInherited, LpDeref(pointer_kind)) |