diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2020-01-14 01:23:51 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2020-01-28 10:12:53 -0300 |
| commit | 4a86c55f566753aea8f3199a7caa93ffdd7a9a86 (patch) | |
| tree | 70fde38a60638eb29d3f1df0ea18c558afeb304c | |
| parent | a71cc4ca117f108508e850936cddf40b702aadb9 (diff) | |
| download | rust-4a86c55f566753aea8f3199a7caa93ffdd7a9a86.tar.gz rust-4a86c55f566753aea8f3199a7caa93ffdd7a9a86.zip | |
record_killed_borrows_for_local takes Local by value
| -rw-r--r-- | src/librustc_mir/borrow_check/constraint_generation.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_mir/borrow_check/constraint_generation.rs b/src/librustc_mir/borrow_check/constraint_generation.rs index 0f6a360c793..d85b55656ca 100644 --- a/src/librustc_mir/borrow_check/constraint_generation.rs +++ b/src/librustc_mir/borrow_check/constraint_generation.rs @@ -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, @@ -199,7 +199,7 @@ impl<'cx, 'cg, 'tcx> ConstraintGeneration<'cx, 'cg, 'tcx> { all_facts, self.borrow_set, self.location_table, - local, + *local, location, ); } @@ -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); |
