Skip to content

Conversation

@Zalathar
Copy link
Member

This PR is another incremental step towards expansion region support in coverage instrumentation.

When preparing coverage mappings for a function, we extract “raw” spans from MIR, and then use “hole” spans extracted from HIR to avoid overlap with nested items and closures. That hole-carving process was historically built around the assumption that there would be one set of spans and holes per function, but expansion region support will need to invalidate that assumption.

Therefore, to be more friendly to future work on expansion regions, this PR associates each hole span with its corresponding node in the expansion tree, and makes the span refinement step obtain holes from the current node.

There should be no change to compiler output.

This is an incremental step towards making the expansion tree central to
coverage mapping creation, which will be needed for proper expansion region
support.
This also replaces `push_covspan` with a separate covspan-filtering step,
because the relevant code is being reindented anyway.
This will make it easier to perform span refinement for child expansions.
@rustbot
Copy link
Collaborator

rustbot commented Nov 11, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 11, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 11, 2025

r? @JonathanBrouwer

rustbot has assigned @JonathanBrouwer.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants