Only consider places with the same local in each_borrow_involving_path.

This commit is contained in:
Camille GILLOT
2023-05-19 08:26:31 +00:00
parent f42f19b6d3
commit 372366d686
3 changed files with 20 additions and 14 deletions

View File

@@ -353,7 +353,6 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
let tcx = self.tcx;
let body = self.body;
let borrow_set = self.borrow_set;
let indices = self.borrow_set.indices();
each_borrow_involving_path(
self,
tcx,
@@ -361,7 +360,7 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
location,
(sd, place),
borrow_set,
indices,
|_| true,
|this, borrow_index, borrow| {
match (rw, borrow.kind) {
// Obviously an activation is compatible with its own