move_error_collector: move_error::MoveErrorCollector::new(),
};
- euv::ExprUseVisitor::new(&mut glcx, bccx.tcx, param_env, &bccx.region_scope_tree, bccx.tables)
+ let rvalue_promotable_map = bccx.tcx.rvalue_promotable_map(def_id);
+ euv::ExprUseVisitor::new(&mut glcx,
+ bccx.tcx,
+ param_env,
+ &bccx.region_scope_tree,
+ bccx.tables,
+ Some(rvalue_promotable_map))
.consume_body(bccx.body);
glcx.report_potential_errors();
self.all_loans.push(loan);
// if loan_gen_scope != borrow_id {
- // FIXME(#6268) Nested method calls
+ // FIXME(https://github.com/rust-lang/rfcs/issues/811) Nested method calls
//
// Typically, the scope of the loan includes the point at
// which the loan is originated. This
//let restr = restrictions::compute_restrictions(
// self.bccx, borrow_span, cmt, RESTR_EMPTY);
//let loan = {
- // let all_loans = &mut *self.all_loans; // FIXME(#5074)
// Loan {
- // index: all_loans.len(),
+ // index: self.all_loans.len(),
// loan_path,
// cmt,
// mutbl: ConstMutability,
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)) |