diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-02-13 20:48:17 -0800 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-02-13 20:48:17 -0800 |
| commit | f0260ae196b62f27c64738d52519efb424724915 (patch) | |
| tree | 4bd7825df15d12b8af1a3466238d3e48f0fb19a9 /src | |
| parent | 95186201724a087bacafc74317722314f203cfdc (diff) | |
| download | rust-f0260ae196b62f27c64738d52519efb424724915.tar.gz rust-f0260ae196b62f27c64738d52519efb424724915.zip | |
Use `seek_before` instead of `seek_after`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/transform/elaborate_drops.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/librustc_mir/transform/elaborate_drops.rs b/src/librustc_mir/transform/elaborate_drops.rs index 28a50547b19..306fe14266f 100644 --- a/src/librustc_mir/transform/elaborate_drops.rs +++ b/src/librustc_mir/transform/elaborate_drops.rs @@ -103,7 +103,7 @@ fn find_dead_unwinds<'tcx>( debug!("find_dead_unwinds @ {:?}: path({:?})={:?}", bb, location, path); - flow_inits.seek_after(body.terminator_loc(bb)); + flow_inits.seek_before(body.terminator_loc(bb)); let mut maybe_live = false; on_all_drop_children_bits(tcx, body, &env, path, |child| { maybe_live |= flow_inits.contains(child); @@ -124,9 +124,9 @@ struct InitializationData<'mir, 'tcx> { } impl InitializationData<'_, '_> { - fn seek_after(&mut self, loc: Location) { - self.inits.seek_after(loc); - self.uninits.seek_after(loc); + fn seek_before(&mut self, loc: Location) { + self.inits.seek_before(loc); + self.uninits.seek_before(loc); } fn state(&self, path: MovePathIndex) -> (bool, bool) { @@ -294,7 +294,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> { _ => continue, }; - self.init_data.seek_after(self.body.terminator_loc(bb)); + self.init_data.seek_before(self.body.terminator_loc(bb)); let path = self.move_data().rev_lookup.find(location.as_ref()); debug!("collect_drop_flags: {:?}, place {:?} ({:?})", bb, location, path); @@ -341,7 +341,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> { let resume_block = self.patch.resume_block(); match terminator.kind { TerminatorKind::Drop { ref location, target, unwind } => { - self.init_data.seek_after(loc); + self.init_data.seek_before(loc); match self.move_data().rev_lookup.find(location.as_ref()) { LookupResult::Exact(path) => elaborate_drop( &mut Elaborator { ctxt: self }, @@ -424,7 +424,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> { match self.move_data().rev_lookup.find(location.as_ref()) { LookupResult::Exact(path) => { debug!("elaborate_drop_and_replace({:?}) - tracked {:?}", terminator, path); - self.init_data.seek_after(loc); + self.init_data.seek_before(loc); elaborate_drop( &mut Elaborator { ctxt: self }, terminator.source_info, |
