Skip to content

Commit e72c3ae

Browse files
committed
test: Try to keep the original cost
1 parent e3c0f1b commit e72c3ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_mir_transform/src/cost_checker.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ impl<'b, 'tcx> CostChecker<'b, 'tcx> {
6060
}
6161

6262
impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
63+
fn visit_var_debug_info(&mut self, _var_debug_info: &VarDebugInfo<'tcx>) {
64+
// Test only: Try to keep the original cost.
65+
self.penalty += INSTR_COST;
66+
}
67+
6368
fn visit_statement(&mut self, statement: &Statement<'tcx>, location: Location) {
6469
// Most costs are in rvalues and terminators, not in statements.
6570
match statement.kind {

0 commit comments

Comments
 (0)