Skip to content

Commit 8616672

Browse files
committed
working on on projection place when visit_assign
1 parent c47b2a9 commit 8616672

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/librustc_mir/borrow_check/nll/constraint_generation.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ impl<'cg, 'cx, 'gcx, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'cx, 'gcx
139139
// `(*X).foo` and so forth.
140140
if let Some(all_facts) = self.all_facts {
141141
if let PlaceBase::Local(temp) = place.base {
142-
if let Some(borrow_indices) = self.borrow_set.local_map.get(&temp) {
143-
for &borrow_index in borrow_indices {
144-
let location_index = self.location_table.mid_index(location);
145-
all_facts.killed.push((borrow_index, location_index));
142+
if place.has_no_projection() {
143+
if let Some(borrow_indices) = self.borrow_set.local_map.get(&temp) {
144+
for &borrow_index in borrow_indices {
145+
let location_index = self.location_table.mid_index(location);
146+
all_facts.killed.push((borrow_index, location_index));
147+
}
146148
}
147149
}
148150
}

0 commit comments

Comments
 (0)