@@ -13,11 +13,7 @@ use rustc_index::vec::IndexVec;
1313use rustc_middle:: mir:: visit:: {
1414 MutVisitor , MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor ,
1515} ;
16- use rustc_middle:: mir:: {
17- BasicBlock , BinOp , Body , Constant , ConstantKind , Local , LocalDecl , LocalKind , Location ,
18- Operand , Place , Rvalue , SourceInfo , Statement , StatementKind , Terminator , TerminatorKind ,
19- RETURN_PLACE ,
20- } ;
16+ use rustc_middle:: mir:: * ;
2117use rustc_middle:: ty:: layout:: { LayoutError , LayoutOf , LayoutOfHelpers , TyAndLayout } ;
2218use rustc_middle:: ty:: InternalSubsts ;
2319use rustc_middle:: ty:: { self , ConstKind , Instance , ParamEnv , Ty , TyCtxt , TypeVisitable } ;
@@ -1008,7 +1004,7 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> {
10081004 let source_info = terminator. source_info ;
10091005 self . source_info = Some ( source_info) ;
10101006 self . super_terminator ( terminator, location) ;
1011- // Do NOT early return in this function, it does some crucial fixup of the state at the end!
1007+
10121008 match & mut terminator. kind {
10131009 TerminatorKind :: Assert { expected, ref mut cond, .. } => {
10141010 if let Some ( ref value) = self . eval_operand ( & cond)
@@ -1050,6 +1046,10 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> {
10501046 // gated on `mir_opt_level=3`.
10511047 TerminatorKind :: Call { .. } => { }
10521048 }
1049+ }
1050+
1051+ fn visit_basic_block_data ( & mut self , block : BasicBlock , data : & mut BasicBlockData < ' tcx > ) {
1052+ self . super_basic_block_data ( block, data) ;
10531053
10541054 // We remove all Locals which are restricted in propagation to their containing blocks and
10551055 // which were modified in the current block.
0 commit comments