Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EndRegion do not always correspond to borrow-data entries #44987

Merged
merged 1 commit into from
Oct 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove assertion that the argument to every EndRegion correspond to
some dataflow-tracked borrow-data entry.

Fix #44828

(The comment thread on the aforementioned issue discusses why its best
to just remove this assertion.)
  • Loading branch information
pnkfelix committed Oct 2, 2017
commit 17f6b6810b4abdbeb4f493e497c13825fb0f6ad4
10 changes: 5 additions & 5 deletions src/librustc_mir/dataflow/impls/borrows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 122,11 @@ impl<'a, 'tcx> BitDenotation for Borrows<'a, 'tcx> {
});
match stmt.kind {
mir::StatementKind::EndRegion(region_scope) => {
let borrow_indexes = self.region_map.get(&ReScope(region_scope)).unwrap_or_else(|| {
panic!("could not find BorrowIndexs for region scope {:?}", region_scope);
});

for idx in borrow_indexes { sets.kill(&idx); }
if let Some(borrow_indexes) = self.region_map.get(&ReScope(region_scope)) {
for idx in borrow_indexes { sets.kill(&idx); }
} else {
// (if there is no entry, then there are no borrows to be tracked)
}
}

mir::StatementKind::Assign(_, ref rhs) => {
Expand Down