@@ -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 , UnOp ,
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 } ;
@@ -1076,7 +1072,7 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> {
1076
1072
let source_info = terminator. source_info ;
1077
1073
self . source_info = Some ( source_info) ;
1078
1074
self . super_terminator ( terminator, location) ;
1079
- // Do NOT early return in this function, it does some crucial fixup of the state at the end!
1075
+
1080
1076
match & mut terminator. kind {
1081
1077
TerminatorKind :: Assert { expected, ref mut cond, .. } => {
1082
1078
if let Some ( ref value) = self . eval_operand ( & cond) {
@@ -1131,6 +1127,10 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> {
1131
1127
// gated on `mir_opt_level=3`.
1132
1128
TerminatorKind :: Call { .. } => { }
1133
1129
}
1130
+ }
1131
+
1132
+ fn visit_basic_block_data ( & mut self , block : BasicBlock , data : & mut BasicBlockData < ' tcx > ) {
1133
+ self . super_basic_block_data ( block, data) ;
1134
1134
1135
1135
// We remove all Locals which are restricted in propagation to their containing blocks and
1136
1136
// which were modified in the current block.
0 commit comments