Skip to content

coverage: Store signature/body spans and branch spans in the expansion tree - #149471

Merged
bors merged 3 commits into
rust-lang:mainfrom
Zalathar:tree
Nov 30, 2025
Merged

coverage: Store signature/body spans and branch spans in the expansion tree#149471
bors merged 3 commits into
rust-lang:mainfrom
Zalathar:tree

Conversation

@Zalathar

Copy link
Copy Markdown
Member

In order to support coverage instrumentation of expansion regions, we need to reduce the amount of code that assumes we're only instrumenting a flat function body. Moving more data into expansion tree nodes is an incremental step in that direction.

There should be no change to compiler output.

@ZalatharZalathar added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Nov 30, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbotrustbot 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 30, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

r? @jdonszelmann

rustbot has assigned @jdonszelmann.
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

@oli-obk

Copy link
Copy Markdown
Contributor

Preexisting, but are there tests for the signature coming from a macro def, but the body from the invocation site? Or where the outer block is also part of the macro and the statements inside are from the call site?

I see the code "handling" it, but not sure what the effects are

@Zalathar

Copy link
Copy Markdown
MemberAuthor

Preexisting, but are there tests for the signature coming from a macro def, but the body from the invocation site? Or where the outer block is also part of the macro and the statements inside are from the call site?

I see the code "handling" it, but not sure what the effects are

Instrumentation of macro expansions has pretty poor test coverage overall, but it was easy enough to add a new test for those specific cases.

The other changes in this PR don't seem to affect the new tests, which is reassuring.

@oli-obk

Copy link
Copy Markdown
Contributor

r? @oli-obk

@bors r+ rollup

@bors

bors commented Nov 30, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit ac43716 has been approved by oli-obk

It is now in the queue for this repository.

@rustbotrustbot assigned oli-obk and unassigned jdonszelmannNov 30, 2025
@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 30, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 30, 2025
coverage: Store signature/body spans and branch spans in the expansion tree
In order to support coverage instrumentation of expansion regions, we need to reduce the amount of code that assumes we're only instrumenting a flat function body. Moving more data into expansion tree nodes is an incremental step in that direction.
There should be no change to compiler output.
bors added a commit that referenced this pull request Nov 30, 2025
Rollup of 3 pull requests
Successful merges:
- #148169 (Fix bad intra-doc-link preprocessing)
- #149471 (coverage: Store signature/body spans and branch spans in the expansion tree)
- #149481 (ThreadId generation fallback path: avoid spurious yields)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Nov 30, 2025
Rollup of 2 pull requests
Successful merges:
- #148169 (Fix bad intra-doc-link preprocessing)
- #149471 (coverage: Store signature/body spans and branch spans in the expansion tree)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit b49b18b into rust-lang:mainNov 30, 2025
11 checks passed
rust-timer added a commit that referenced this pull request Nov 30, 2025
Rollup merge of #149471 - Zalathar:tree, r=oli-obk
coverage: Store signature/body spans and branch spans in the expansion tree
In order to support coverage instrumentation of expansion regions, we need to reduce the amount of code that assumes we're only instrumenting a flat function body. Moving more data into expansion tree nodes is an incremental step in that direction.
There should be no change to compiler output.
@rustbotrustbot added this to the 1.93.0 milestone Nov 30, 2025
@Zalathar
Zalathar deleted the tree branch November 30, 2025 23:05
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

5 participants

@Zalathar@rustbot@oli-obk@bors@jdonszelmann