Skip to content

Commit

Permalink
record_killed_borrows_for_local takes Local by value
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jan 28, 2020
1 parent a71cc4c commit 4a86c55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc_mir/borrow_check/constraint_generation.rs
Expand Up @@ -97,7 +97,7 @@ impl<'cg, 'cx, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'cx, 'tcx> {
));

// If there are borrows on this now dead local, we need to record them as `killed`.
if let StatementKind::StorageDead(ref local) = statement.kind {
if let StatementKind::StorageDead(local) = statement.kind {
record_killed_borrows_for_local(
all_facts,
self.borrow_set,
Expand Down Expand Up @@ -199,7 +199,7 @@ impl<'cx, 'cg, 'tcx> ConstraintGeneration<'cx, 'cg, 'tcx> {
all_facts,
self.borrow_set,
self.location_table,
local,
*local,
location,
);
}
Expand Down Expand Up @@ -239,10 +239,10 @@ fn record_killed_borrows_for_local(
all_facts: &mut AllFacts,
borrow_set: &BorrowSet<'_>,
location_table: &LocationTable,
local: &Local,
local: Local,
location: Location,
) {
if let Some(borrow_indices) = borrow_set.local_map.get(local) {
if let Some(borrow_indices) = borrow_set.local_map.get(&local) {
all_facts.killed.reserve(borrow_indices.len());
for &borrow_index in borrow_indices {
let location_index = location_table.mid_index(location);
Expand Down

0 comments on commit 4a86c55

Please sign in to comment.