File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
rustc_middle/src/mir/terminator Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ pub enum TerminatorKind<'tcx> {
9696 /// P <- V
9797 /// }
9898 /// ```
99+ ///
100+ /// Note that DropAndReplace is eliminated as part of the `ElaborateDrops` pass.
99101 DropAndReplace {
100102 place : Place < ' tcx > ,
101103 value : Operand < ' tcx > ,
Original file line number Diff line number Diff line change @@ -38,8 +38,7 @@ impl<'tcx> MirPass<'tcx> for RemoveUnneededDrops {
3838impl < ' a , ' tcx > Visitor < ' tcx > for RemoveUnneededDropsOptimizationFinder < ' a , ' tcx > {
3939 fn visit_terminator ( & mut self , terminator : & Terminator < ' tcx > , location : Location ) {
4040 match terminator. kind {
41- TerminatorKind :: Drop { place, target, .. }
42- | TerminatorKind :: DropAndReplace { place, target, .. } => {
41+ TerminatorKind :: Drop { place, target, .. } => {
4342 let ty = place. ty ( self . body , self . tcx ) ;
4443 let needs_drop = ty. ty . needs_drop ( self . tcx , self . tcx . param_env ( self . def_id ) ) ;
4544 if !needs_drop {
You can’t perform that action at this time.
0 commit comments