rust icon indicating copy to clipboard operation
rust copied to clipboard

coverage: Improve handling of function/closure spans

Open Zalathar opened this issue 6 months ago • 5 comments

This is a combination of some loosely-related changes that touch the same code:

  1. 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.
  2. Skip the normal span-refinement code when dealing with the trivial outer part of an async function.
  3. 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

Zalathar avatar Feb 02 '24 01:02 Zalathar

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

rustbot avatar Feb 02 '24 01:02 rustbot

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

rustbot avatar Feb 02 '24 01:02 rustbot

@bors r+ rollup

r? @oli-obk

oli-obk avatar Feb 02 '24 10:02 oli-obk

:pushpin: Commit 23fb8946b0372c1340a083e75e3e24c56352fc31 has been approved by oli-obk

It is now in the queue for this repository.

bors avatar Feb 02 '24 10:02 bors

:evergreen_tree: The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

bors avatar Feb 02 '24 10:02 bors

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.

Zalathar avatar Feb 04 '24 00:02 Zalathar

:umbrella: The latest upstream changes (presumably #120620) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Feb 04 '24 21:02 bors

Rebased to resolve trivial conflict in a test file; no functional changes.

Zalathar avatar Feb 04 '24 23:02 Zalathar

@rustbot ready

Zalathar avatar Feb 04 '24 23:02 Zalathar

@bors r+

oli-obk avatar Feb 04 '24 23:02 oli-obk

:pushpin: Commit a246b6be1dcd4a8ea0ac468921af7e8022686849 has been approved by oli-obk

It is now in the queue for this repository.

bors avatar Feb 04 '24 23:02 bors