Skip to content

Commit 4a86c55

Browse files
committed
record_killed_borrows_for_local takes Local by value
1 parent a71cc4c commit 4a86c55

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_mir/borrow_check/constraint_generation.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<'cg, 'cx, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'cx, 'tcx> {
9797
));
9898

9999
// If there are borrows on this now dead local, we need to record them as `killed`.
100-
if let StatementKind::StorageDead(ref local) = statement.kind {
100+
if let StatementKind::StorageDead(local) = statement.kind {
101101
record_killed_borrows_for_local(
102102
all_facts,
103103
self.borrow_set,
@@ -199,7 +199,7 @@ impl<'cx, 'cg, 'tcx> ConstraintGeneration<'cx, 'cg, 'tcx> {
199199
all_facts,
200200
self.borrow_set,
201201
self.location_table,
202-
local,
202+
*local,
203203
location,
204204
);
205205
}
@@ -239,10 +239,10 @@ fn record_killed_borrows_for_local(
239239
all_facts: &mut AllFacts,
240240
borrow_set: &BorrowSet<'_>,
241241
location_table: &LocationTable,
242-
local: &Local,
242+
local: Local,
243243
location: Location,
244244
) {
245-
if let Some(borrow_indices) = borrow_set.local_map.get(local) {
245+
if let Some(borrow_indices) = borrow_set.local_map.get(&local) {
246246
all_facts.killed.reserve(borrow_indices.len());
247247
for &borrow_index in borrow_indices {
248248
let location_index = location_table.mid_index(location);

0 commit comments

Comments
 (0)