Skip to content

Commit 2a95ee6

Browse files
committed
Allow MIR pass UnreachableProp when coverage is enabled
Now that coverage has a dedicated MIR pass to detect and repair instrumented functions that have lost all their counters, it should be OK to permit this pass in coverage builds.
1 parent e6b2828 commit 2a95ee6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

compiler/rustc_mir_transform/src/unreachable_prop.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ pub struct UnreachablePropagation;
1313
impl MirPass<'_> for UnreachablePropagation {
1414
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
1515
// Enable only under -Zmir-opt-level=2 as this can make programs less debuggable.
16-
17-
// FIXME(#116171) Coverage gets confused by MIR passes that can remove all
18-
// coverage statements from an instrumented function. This pass can be
19-
// re-enabled when coverage codegen is robust against that happening.
20-
sess.mir_opt_level() >= 2 && !sess.instrument_coverage()
16+
sess.mir_opt_level() >= 2
2117
}
2218

2319
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {

0 commit comments

Comments
 (0)