@@ -13,11 +13,7 @@ use rustc_index::vec::IndexVec;
13
13
use rustc_middle:: mir:: visit:: {
14
14
MutVisitor , MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor ,
15
15
} ;
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:: * ;
21
17
use rustc_middle:: ty:: layout:: { LayoutError , LayoutOf , LayoutOfHelpers , TyAndLayout } ;
22
18
use rustc_middle:: ty:: InternalSubsts ;
23
19
use rustc_middle:: ty:: { self , ConstKind , Instance , ParamEnv , Ty , TyCtxt , TypeVisitable } ;
@@ -1008,7 +1004,7 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> {
1008
1004
let source_info = terminator. source_info ;
1009
1005
self . source_info = Some ( source_info) ;
1010
1006
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
+
1012
1008
match & mut terminator. kind {
1013
1009
TerminatorKind :: Assert { expected, ref mut cond, .. } => {
1014
1010
if let Some ( ref value) = self . eval_operand ( & cond)
@@ -1050,6 +1046,10 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> {
1050
1046
// gated on `mir_opt_level=3`.
1051
1047
TerminatorKind :: Call { .. } => { }
1052
1048
}
1049
+ }
1050
+
1051
+ fn visit_basic_block_data ( & mut self , block : BasicBlock , data : & mut BasicBlockData < ' tcx > ) {
1052
+ self . super_basic_block_data ( block, data) ;
1053
1053
1054
1054
// We remove all Locals which are restricted in propagation to their containing blocks and
1055
1055
// which were modified in the current block.
0 commit comments