Skip to content

Commit 9a56933

Browse files
committed
Create visit_block_data for const-prop-lint.
1 parent 38b9655 commit 9a56933

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_mir_transform/src/const_prop_lint.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ use rustc_hir::HirId;
1414
use rustc_index::bit_set::BitSet;
1515
use rustc_index::vec::IndexVec;
1616
use rustc_middle::mir::visit::Visitor;
17-
use rustc_middle::mir::{
18-
AssertKind, BinOp, Body, Constant, Local, LocalDecl, Location, Operand, Place, Rvalue,
19-
SourceInfo, SourceScope, SourceScopeData, Statement, StatementKind, Terminator, TerminatorKind,
20-
UnOp, RETURN_PLACE,
21-
};
17+
use rustc_middle::mir::*;
2218
use rustc_middle::ty::layout::{LayoutError, LayoutOf, LayoutOfHelpers, TyAndLayout};
2319
use rustc_middle::ty::InternalSubsts;
2420
use rustc_middle::ty::{
@@ -695,6 +691,10 @@ impl<'tcx> Visitor<'tcx> for ConstPropagator<'_, 'tcx> {
695691
| TerminatorKind::Call { .. }
696692
| TerminatorKind::InlineAsm { .. } => {}
697693
}
694+
}
695+
696+
fn visit_basic_block_data(&mut self, block: BasicBlock, data: &BasicBlockData<'tcx>) {
697+
self.super_basic_block_data(block, data);
698698

699699
// We remove all Locals which are restricted in propagation to their containing blocks and
700700
// which were modified in the current block.

0 commit comments

Comments
 (0)