Skip to content

Conversation

@Zalathar
Copy link
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.

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

rustbot commented Nov 30, 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 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 30, 2025

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
Contributor

oli-obk commented Nov 30, 2025

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
Member Author

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
Contributor

oli-obk commented Nov 30, 2025

r? @oli-obk

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 30, 2025

📌 Commit ac43716 has been approved by oli-obk

It is now in the queue for this repository.

@rustbot rustbot assigned oli-obk and unassigned jdonszelmann Nov 30, 2025
@bors bors 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
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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

5 participants