@@ -4,7 +4,9 @@ use rustc_abi::VariantIdx;
44use rustc_index:: Idx ;
55use rustc_index:: bit_set:: { DenseBitSet , MixedBitSet } ;
66use rustc_middle:: bug;
7- use rustc_middle:: mir:: { self , Body , CallReturnPlaces , Location , TerminatorEdges } ;
7+ use rustc_middle:: mir:: {
8+ self , Body , CallReturnPlaces , Location , SwitchTargetValue , TerminatorEdges ,
9+ } ;
810use rustc_middle:: ty:: util:: Discr ;
911use rustc_middle:: ty:: { self , TyCtxt } ;
1012use tracing:: { debug, instrument} ;
@@ -424,7 +426,7 @@ impl<'tcx> Analysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
424426 state : & mut Self :: Domain ,
425427 edge : SwitchIntTarget ,
426428 ) {
427- if let Some ( value) = edge. value {
429+ if let SwitchTargetValue :: Normal ( value) = edge. value {
428430 // Kill all move paths that correspond to variants we know to be inactive along this
429431 // particular outgoing edge of a `SwitchInt`.
430432 drop_flag_effects:: on_all_inactive_variants (
@@ -537,7 +539,7 @@ impl<'tcx> Analysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
537539 state : & mut Self :: Domain ,
538540 edge : SwitchIntTarget ,
539541 ) {
540- if let Some ( value) = edge. value {
542+ if let SwitchTargetValue :: Normal ( value) = edge. value {
541543 // Mark all move paths that correspond to variants other than this one as maybe
542544 // uninitialized (in reality, they are *definitely* uninitialized).
543545 drop_flag_effects:: on_all_inactive_variants (
0 commit comments