From: Matthew Jasper Date: Sun, 29 Jul 2018 17:02:13 +0000 (+0100) Subject: Change order of copy and borrow to avoid conflict X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=18d5f821480803811f3f7ef866ef0ef8ae9bf9c1;p=rust.git Change order of copy and borrow to avoid conflict Note that the first argument is `self as &mut dyn Delegate`, so this isn't allowed with two-phase borrows. --- diff --git a/src/librustc_passes/rvalue_promotion.rs b/src/librustc_passes/rvalue_promotion.rs index d223dc2a353..114fd8754a2 100644 --- a/src/librustc_passes/rvalue_promotion.rs +++ b/src/librustc_passes/rvalue_promotion.rs @@ -248,7 +248,8 @@ fn check_nested_body(&mut self, body_id: hir::BodyId) -> Promotability { let tcx = self.tcx; let param_env = self.param_env; let region_scope_tree = self.tcx.region_scope_tree(item_def_id); - euv::ExprUseVisitor::new(self, tcx, param_env, ®ion_scope_tree, self.tables, None) + let tables = self.tables; + euv::ExprUseVisitor::new(self, tcx, param_env, ®ion_scope_tree, tables, None) .consume_body(body); let body_promotable = self.check_expr(&body.value);