1
Fork 0

coverage: Re-enable UnreachablePropagation for coverage builds

This commit is contained in:
Zalathar 2024-03-22 13:34:26 +11:00
parent 54116c8cae
commit 1cca2529d1
2 changed files with 4 additions and 8 deletions

View file

@ -14,11 +14,7 @@ pub struct UnreachablePropagation;
impl MirPass<'_> for UnreachablePropagation {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
// Enable only under -Zmir-opt-level=2 as this can make programs less debuggable.
// FIXME(#116171) Coverage gets confused by MIR passes that can remove all
// coverage statements from an instrumented function. This pass can be
// re-enabled when coverage codegen is robust against that happening.
sess.mir_opt_level() >= 2 && !sess.instrument_coverage()
sess.mir_opt_level() >= 2
}
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {