]> git.lizzy.rs Git - rust.git/commitdiff
Change order of copy and borrow to avoid conflict
authorMatthew Jasper <mjjasper1@gmail.com>
Sun, 29 Jul 2018 17:02:13 +0000 (18:02 +0100)
committerMatthew Jasper <mjjasper1@gmail.com>
Sun, 29 Jul 2018 17:04:09 +0000 (18:04 +0100)
Note that the first argument is `self as &mut dyn Delegate`, so this
isn't allowed with two-phase borrows.

src/librustc_passes/rvalue_promotion.rs

index d223dc2a353356799375a9aa818905415b1c0879..114fd8754a21fb21e256eb765c56d6f53f42d062 100644 (file)
@@ -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, &region_scope_tree, self.tables, None)
+        let tables = self.tables;
+        euv::ExprUseVisitor::new(self, tcx, param_env, &region_scope_tree, tables, None)
             .consume_body(body);
 
         let body_promotable = self.check_expr(&body.value);