Skip to content

Commit

Permalink
Auto merge of #51849 - nikomatsakis:issue-51820-places-conflict, r=eddyb
Browse files Browse the repository at this point in the history
optimize `places_conflict` to avoid complex vectors etc

Fixes #51820
  • Loading branch information
bors committed Jun 30, 2018
2 parents 8772747 + cb34989 commit 74c89b0
Show file tree
Hide file tree
Showing 3 changed files with 448 additions and 362 deletions.
5 changes: 3 additions & 2 deletions src/librustc_mir/borrow_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ mod flows;
mod location;
mod path_utils;
crate mod place_ext;
mod places_conflict;
mod prefixes;
mod used_muts;
mod move_errors;
Expand Down Expand Up @@ -1309,7 +1310,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
// that is merged.
let sd = if might_be_alive { Deep } else { Shallow(None) };

if places_conflict(self.tcx, self.mir, place, root_place, sd) {
if places_conflict::places_conflict(self.tcx, self.mir, place, root_place, sd) {
debug!("check_for_invalidation_at_exit({:?}): INVALID", place);
// FIXME: should be talking about the region lifetime instead
// of just a span here.
Expand Down Expand Up @@ -1400,7 +1401,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
for i in flow_state.ever_inits.iter_incoming() {
let init = self.move_data.inits[i];
let init_place = &self.move_data.move_paths[init.path].place;
if places_conflict(self.tcx, self.mir, &init_place, place, Deep) {
if places_conflict::places_conflict(self.tcx, self.mir, &init_place, place, Deep) {
self.report_illegal_reassignment(context, (place, span), init.span, err_place);
break;
}
Expand Down
Loading

0 comments on commit 74c89b0

Please sign in to comment.