Skip to content

Commit

Permalink
Remove assertion that the argument to every EndRegion correspond to
Browse files Browse the repository at this point in the history
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
1 parent 2146c61 commit 17f6b68
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/librustc_mir/dataflow/impls/borrows.rs
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

0 comments on commit 17f6b68

Please sign in to comment.