1
Fork 0

Add -Zprecise-enum-drop-elaboration

Its purpose is to assist in debugging #77382 and #74551.
This commit is contained in:
Dylan MacKenzie 2020-10-01 11:31:43 -07:00
parent 2ad6187ce5
commit 6691d11234
3 changed files with 13 additions and 0 deletions

View file

@ -358,6 +358,10 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
discr: &mir::Operand<'tcx>,
edge_effects: &mut impl SwitchIntEdgeEffects<G>,
) {
if !self.tcx.sess.opts.debugging_opts.precise_enum_drop_elaboration {
return;
}
let enum_ = discr.place().and_then(|discr| {
switch_on_enum_discriminant(self.tcx, &self.body, &self.body[block], discr)
});
@ -469,6 +473,10 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
discr: &mir::Operand<'tcx>,
edge_effects: &mut impl SwitchIntEdgeEffects<G>,
) {
if !self.tcx.sess.opts.debugging_opts.precise_enum_drop_elaboration {
return;
}
if !self.mark_inactive_variants_as_uninit {
return;
}