We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 673935f commit 30dd6cfCopy full SHA for 30dd6cf
compiler/rustc_mir/src/transform/remove_unneeded_drops.rs
@@ -29,7 +29,8 @@ impl<'tcx> MirPass<'tcx> for RemoveUnneededDrops {
29
impl<'a, 'tcx> Visitor<'tcx> for RemoveUnneededDropsOptimizationFinder<'a, 'tcx> {
30
fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location) {
31
match terminator.kind {
32
- TerminatorKind::Drop { place, target, .. } => {
+ TerminatorKind::Drop { place, target, .. }
33
+ | TerminatorKind::DropAndReplace { place, target, .. } => {
34
let ty = place.ty(self.body, self.tcx);
35
let needs_drop = ty.ty.needs_drop(self.tcx, self.tcx.param_env(self.def_id));
36
if !needs_drop {
0 commit comments