rust
rust copied to clipboard
coverage: Improve handling of function/closure spans
This is a combination of some loosely-related changes that touch the same code:
- Make unexpansion of closure bodies more precise, by unexpanding back to the context of the closure declaration, instead of unexpanding all the way back to the top-level context. This preserves the way we handle async desugaring and closures containing a single bang-macro, while also giving better results for closures defined in macros.
- Skip the normal span-refinement code when dealing with the trivial outer part of an async function.
- Be more explicit about the fact that
fn_sig_span
has been extended to the start of the function body, and is not necessarily present.
@rustbot label +A-code-coverage
r? @TaKO8Ki
(rustbot has picked a reviewer for you, use r? to override)
Some changes occurred to MIR optimizations
cc @rust-lang/wg-mir-opt
@bors r+ rollup
r? @oli-obk
:pushpin: Commit 23fb8946b0372c1340a083e75e3e24c56352fc31 has been approved by oli-obk
It is now in the queue for this repository.
:evergreen_tree: The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.
This was excluded from rollup #120620 because it has an incidental conflict with #120566 in some test headers.
Since that rollup will hopefully land relatively soon, I’ll just rebase this afterwards.
:umbrella: The latest upstream changes (presumably #120620) made this pull request unmergeable. Please resolve the merge conflicts.
Rebased to resolve trivial conflict in a test file; no functional changes.
@rustbot ready
@bors r+
:pushpin: Commit a246b6be1dcd4a8ea0ac468921af7e8022686849 has been approved by oli-obk
It is now in the queue for this repository.