about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2023-12-09 00:48:08 -0800
committerGitHub <noreply@github.com>2023-12-09 00:48:08 -0800
commita71ab454ac7c5da902a58b53714874d6dc4c8d71 (patch)
tree1e67d8c5a11c211405fe971b0d2186ca806a31ca /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs
parent608f32435afd5b61f61c593e70df1a2b8ada6a79 (diff)
parentd90fd027c887247caa501db5f49352fdfab769d9 (diff)
downloadrust-a71ab454ac7c5da902a58b53714874d6dc4c8d71.tar.gz
rust-a71ab454ac7c5da902a58b53714874d6dc4c8d71.zip
Rollup merge of #118198 - Zalathar:if-not, r=cjgillot
coverage: Use `SpanMarker` to improve coverage spans for `if !` expressions

Coverage instrumentation works by extracting source code spans from MIR. However, some kinds of syntax are effectively erased during MIR building, so their spans don't necessarily exist anywhere in MIR, making them invisible to the coverage instrumentor (unless we resort to various heuristics and hacks to recover them).

This PR introduces `CoverageKind::SpanMarker`, which is a new variant of `StatementKind::Coverage`. Its sole purpose is to represent spans that would otherwise not appear in MIR, so that the coverage instrumentor can extract them.

When coverage is enabled, the MIR builder can insert these dummy statements as needed, to improve the accuracy of spans used by coverage mappings.

Fixes #115468.

---

```@rustbot``` label +A-code-coverage
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs')
0 files changed, 0 insertions, 0 deletions