Do not call query to compute coroutine layout for synthetic body of async closure by compiler-errors · Pull Request #129847 · rust-lang/rust (original) (raw)
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation5 Commits1 Checks6 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
There is code in the MIR validator that attempts to prevent query cycles when inlining a coroutine into itself, and will use the coroutine layout directly from the body when it detects that's the same coroutine as the one that's being validated. After #128506, this logic didn't take into account the fact that the coroutine def id will differ if it's the "by-move body" of an async closure. This PR implements that.
Fixes #129811
r? @davidtwco
rustbot has assigned @davidtwco.
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
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Some changes occurred to MIR optimizations
cc @rust-lang/wg-mir-opt
This comment has been minimized.
📌 Commit 384aed8 has been approved by davidtwco
It is now in the queue for this repository.
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
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 10 pull requests
Successful merges:
- rust-lang#126452 (Implement raw lifetimes and labels (
'r#ident
)) - rust-lang#129555 (stabilize const_float_bits_conv)
- rust-lang#129594 (explain the options bootstrap passes to curl)
- rust-lang#129677 (Don't build by-move body when async closure is tainted)
- rust-lang#129847 (Do not call query to compute coroutine layout for synthetic body of async closure)
- rust-lang#129869 (add a few more crashtests)
- rust-lang#130009 (rustdoc-search: allow trailing
Foo ->
arg search) - rust-lang#130046 (str: make as_mut_ptr and as_bytes_mut unstably const)
- rust-lang#130047 (Win: Add dbghelp to the list of import libraries)
- rust-lang#130059 (Remove the unused
llvm-skip-rebuild
option from x.py)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#129847 - compiler-errors:async-cycle, r=davidtwco
Do not call query to compute coroutine layout for synthetic body of async closure
There is code in the MIR validator that attempts to prevent query cycles when inlining a coroutine into itself, and will use the coroutine layout directly from the body when it detects that's the same coroutine as the one that's being validated. After rust-lang#128506, this logic didn't take into account the fact that the coroutine def id will differ if it's the "by-move body" of an async closure. This PR implements that.
Fixes rust-lang#129811
Zalathar added a commit to Zalathar/rust that referenced this pull request
Don't call closure_by_move_body_def_id on FnOnce async closures in MIR validation
Refactors the check in rust-lang#129847 to not unncessarily call the closure_by_move_body_def_id
query for async closures that don't need a by-move body.
Fixes rust-lang#130167
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#130199 - compiler-errors:by-move, r=cjgillot
Don't call closure_by_move_body_def_id on FnOnce async closures in MIR validation
Refactors the check in rust-lang#129847 to not unncessarily call the closure_by_move_body_def_id
query for async closures that don't need a by-move body.
Fixes rust-lang#130167
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.