Skip to content

Commit 860f71f

Browse files
committed
Polonius fact generation: fix path access fact location
This will fix the other move errors false positives: emitting the fact at the start point caused accesses to be at the same point as an initialization fact of the return place of a call on the following block, which emitted an error.
1 parent df1ac67 commit 860f71f

File tree

1 file changed

+1
-1
lines changed
  • src/librustc_mir/borrow_check/type_check/liveness

1 file changed

+1
-1
lines changed

src/librustc_mir/borrow_check/type_check/liveness/polonius.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl UseFactsExtractor<'_> {
4343

4444
fn insert_path_access(&mut self, path: MovePathIndex, location: Location) {
4545
debug!("UseFactsExtractor::insert_path_access({:?}, {:?})", path, location);
46-
self.path_accessed_at_base.push((path, self.location_table.start_index(location)));
46+
self.path_accessed_at_base.push((path, self.location_to_index(location)));
4747
}
4848

4949
fn place_to_mpi(&self, place: &Place<'_>) -> Option<MovePathIndex> {

0 commit comments

Comments
 (0)