diff options
| author | Giacomo Pasini <giacomo@status.im> | 2023-03-05 21:02:14 +0100 |
|---|---|---|
| committer | Giacomo Pasini <giacomo@status.im> | 2023-03-07 14:25:22 +0100 |
| commit | c5d4e4d907047580f028c6ca7b36a82ef94d28d1 (patch) | |
| tree | 5e86d4fcf511875c88ce5e828e72386387c53efd /compiler/rustc_mir_transform/src/inline.rs | |
| parent | 14c54b637b18f74680d0c0441216714b5e9c150d (diff) | |
| download | rust-c5d4e4d907047580f028c6ca7b36a82ef94d28d1.tar.gz rust-c5d4e4d907047580f028c6ca7b36a82ef94d28d1.zip | |
Remove DropAndReplace terminator
PR 107844 made DropAndReplace unused, let's remove it completely from the codebase.
Diffstat (limited to 'compiler/rustc_mir_transform/src/inline.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/inline.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs index 6e6d6566f4b..9cba8870f23 100644 --- a/compiler/rustc_mir_transform/src/inline.rs +++ b/compiler/rustc_mir_transform/src/inline.rs @@ -453,9 +453,7 @@ impl<'tcx> Inliner<'tcx> { checker.visit_basic_block_data(bb, blk); let term = blk.terminator(); - if let TerminatorKind::Drop { ref place, target, unwind } - | TerminatorKind::DropAndReplace { ref place, target, unwind, .. } = term.kind - { + if let TerminatorKind::Drop { ref place, target, unwind } = term.kind { work_list.push(target); // If the place doesn't actually need dropping, treat it like a regular goto. @@ -815,8 +813,7 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> { fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location) { let tcx = self.tcx; match terminator.kind { - TerminatorKind::Drop { ref place, unwind, .. } - | TerminatorKind::DropAndReplace { ref place, unwind, .. } => { + TerminatorKind::Drop { ref place, unwind, .. } => { // If the place doesn't actually need dropping, treat it like a regular goto. let ty = self.instance.subst_mir(tcx, &place.ty(self.callee_body, tcx).ty); if ty.needs_drop(tcx, self.param_env) { @@ -1120,8 +1117,7 @@ impl<'tcx> MutVisitor<'tcx> for Integrator<'_, 'tcx> { *tgt = self.map_block(*tgt); } } - TerminatorKind::Drop { ref mut target, ref mut unwind, .. } - | TerminatorKind::DropAndReplace { ref mut target, ref mut unwind, .. } => { + TerminatorKind::Drop { ref mut target, ref mut unwind, .. } => { *target = self.map_block(*target); *unwind = self.map_unwind(*unwind); } |
