about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-01 20:14:42 +0000
committerbors <bors@rust-lang.org>2023-10-01 20:14:42 +0000
commit51ddc7467978e265d2004d58980580293734ca93 (patch)
tree80248bb9b474dd365dae1a7964bc5311152e4180 /compiler/rustc_trait_selection/src/errors.rs
parent0e1dd179f1968d534c656e4fd0be8ccf27438d21 (diff)
parent3de082497e4581cb8ba977511dfacc848cffef37 (diff)
downloadrust-51ddc7467978e265d2004d58980580293734ca93.tar.gz
rust-51ddc7467978e265d2004d58980580293734ca93.zip
Auto merge of #116304 - Zalathar:unreachable, r=cjgillot
coverage: Regression test for functions with unreachable bodies

This is a regression test for the coverage issue that was addressed temporarily by #116166, and is tracked by #116171.

---

If we instrument a function for coverage, but all of its counter-increment statements are removed by MIR optimizations, LLVM will think it isn't instrumented and it will disappear from coverage maps and coverage reports.

Most MIR opts won't cause this because they tend not to remove statements from bb0, but `UnreachablePropagation` can do so if it sees that bb0 ends with `TerminatorKind::Unreachable`.

Currently we have worked around this by turning off `UnreachablePropagation` when coverage instrumentation is enabled, which is why this test is able to pass.

---

`@rustbot` label +A-code-coverage
Diffstat (limited to 'compiler/rustc_trait_selection/src/errors.rs')
0 files changed, 0 insertions, 0 deletions