diff options
| author | Remy Rakic <remy.rakic@gmail.com> | 2020-03-30 01:13:03 +0200 |
|---|---|---|
| committer | Remy Rakic <remy.rakic@gmail.com> | 2020-03-30 01:13:03 +0200 |
| commit | 860f71f141baf8228a9d71a75092ff2378bfee42 (patch) | |
| tree | a11e29403afcba0a105b170e1b8e7348cc50febb | |
| parent | df1ac679135f5e8dfbfdc948b906890d44436f50 (diff) | |
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.
| -rw-r--r-- | src/librustc_mir/borrow_check/type_check/liveness/polonius.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_mir/borrow_check/type_check/liveness/polonius.rs b/src/librustc_mir/borrow_check/type_check/liveness/polonius.rs index 407e0628b6e..1c1983fefd4 100644 --- a/src/librustc_mir/borrow_check/type_check/liveness/polonius.rs +++ b/src/librustc_mir/borrow_check/type_check/liveness/polonius.rs @@ -43,7 +43,7 @@ impl UseFactsExtractor<'_> { fn insert_path_access(&mut self, path: MovePathIndex, location: Location) { debug!("UseFactsExtractor::insert_path_access({:?}, {:?})", path, location); - self.path_accessed_at_base.push((path, self.location_table.start_index(location))); + self.path_accessed_at_base.push((path, self.location_to_index(location))); } fn place_to_mpi(&self, place: &Place<'_>) -> Option<MovePathIndex> { |
