Skip to content

Commit

Permalink
Only emit drop for remaining variants if they have fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Jan 23, 2020
1 parent 5e8897b commit 06dbaec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_mir/util/elaborate_drops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ where
}
let (normal, _) = self.drop_ladder(fields, succ, unwind);
normal_blocks.push(normal);
} else {
} else if !adt.variants[variant_index].fields.is_empty() {
have_otherwise = true;
}
}
Expand Down

0 comments on commit 06dbaec

Please # to comment.