Skip to content

Commit 74c89b0

Browse files
committed
Auto merge of #51849 - nikomatsakis:issue-51820-places-conflict, r=eddyb
optimize `places_conflict` to avoid complex vectors etc Fixes #51820
2 parents 8772747 + cb34989 commit 74c89b0

File tree

3 files changed

+448
-362
lines changed

3 files changed

+448
-362
lines changed

Diff for: src/librustc_mir/borrow_check/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ mod flows;
5959
mod location;
6060
mod path_utils;
6161
crate mod place_ext;
62+
mod places_conflict;
6263
mod prefixes;
6364
mod used_muts;
6465
mod move_errors;
@@ -1309,7 +1310,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
13091310
// that is merged.
13101311
let sd = if might_be_alive { Deep } else { Shallow(None) };
13111312

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

0 commit comments

Comments
 (0)