-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Support opaque_types_defined_by
for SyntheticCoroutineBody
#141584
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 and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bors
merged 1 commit into
rust-lang:master
from
compiler-errors:typing-env-synthetic-body
May 27, 2025
Merged
Support opaque_types_defined_by
for SyntheticCoroutineBody
#141584
bors
merged 1 commit into
rust-lang:master
from
compiler-errors:typing-env-synthetic-body
May 27, 2025
+18
−3
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
@bors r+ rollup |
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this pull request
May 26, 2025
…ic-body, r=lcnr Support `opaque_types_defined_by` for `SyntheticCoroutineBody` We create a synthetic MIR body for the `AsyncFnOnce` impl for async closures. That body goes through all passes that a regular body does, including promotion. Promotion sometimes requires computing that the type of an rvalue is `Freeze`, which requires computing the typing env of a body. This requires calling `opaque_types_defined_by` on the body's def id, which leads to an ICE today since we don't expect that query to be called for synthetic bodies. While we could fix this by, for example, computing the typeck root of the body before calling a `TypingEnv` constructor, I think it's appropriate to do a more general fix here since I think it's reasonable that other passes might do analysis too. Fixes rust-lang#141466 r? `@lcnr` or `@oli-obk`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
May 27, 2025
…ic-body, r=lcnr Support `opaque_types_defined_by` for `SyntheticCoroutineBody` We create a synthetic MIR body for the `AsyncFnOnce` impl for async closures. That body goes through all passes that a regular body does, including promotion. Promotion sometimes requires computing that the type of an rvalue is `Freeze`, which requires computing the typing env of a body. This requires calling `opaque_types_defined_by` on the body's def id, which leads to an ICE today since we don't expect that query to be called for synthetic bodies. While we could fix this by, for example, computing the typeck root of the body before calling a `TypingEnv` constructor, I think it's appropriate to do a more general fix here since I think it's reasonable that other passes might do analysis too. Fixes rust-lang#141466 r? ``@lcnr`` or ``@oli-obk``
bors
added a commit
that referenced
this pull request
May 27, 2025
…rors Rollup of 17 pull requests Successful merges: - #140591 (Fix malformed suggestion for E0061 when method is a macro token in macro context) - #141536 (Improve `ambiguous_wide_pointer_comparisons` lint compare diagnostics) - #141552 (Pull out dedicated `cfg_version` syntax test from feature gate test) - #141556 (bootstrap: translate Windows paths in a way that works for both Cygwin and MSYS2) - #141563 (Remove out-of-date `noop_*` names.) - #141568 (dist: make sure llvm-project submodule is present) - #141580 (Use more detailed spans in dyn compat errors within bodies) - #141582 (intrinsics, ScalarInt: minor cleanup) - #141584 (Support `opaque_types_defined_by` for `SyntheticCoroutineBody`) - #141587 (Add missing edition directives for async-await tests) - #141594 (Add `generic_arg_infer` test) - #141596 (rustc book: fix erratic sentence by making it more simple) - #141599 (Remove an unnecessary use of `Box::into_inner`.) - #141611 (Update mdbook to 0.4.51) - #141616 (Remove spastorino from vacations) - #141623 (use custom types to clarify arguments to `emit_ptr_va_arg`) - #141635 (further dedup `WalkItemKind` for `mut_visit` and `visit`) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
May 27, 2025
Rollup of 8 pull requests Successful merges: - #141584 (Support `opaque_types_defined_by` for `SyntheticCoroutineBody`) - #141587 (Add missing edition directives for async-await tests) - #141594 (Add `generic_arg_infer` test) - #141596 (rustc book: fix erratic sentence by making it more simple) - #141599 (Remove an unnecessary use of `Box::into_inner`.) - #141611 (Update mdbook to 0.4.51) - #141616 (Remove spastorino from vacations) - #141623 (use custom types to clarify arguments to `emit_ptr_va_arg`) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
May 27, 2025
Rollup merge of #141584 - compiler-errors:typing-env-synthetic-body, r=lcnr Support `opaque_types_defined_by` for `SyntheticCoroutineBody` We create a synthetic MIR body for the `AsyncFnOnce` impl for async closures. That body goes through all passes that a regular body does, including promotion. Promotion sometimes requires computing that the type of an rvalue is `Freeze`, which requires computing the typing env of a body. This requires calling `opaque_types_defined_by` on the body's def id, which leads to an ICE today since we don't expect that query to be called for synthetic bodies. While we could fix this by, for example, computing the typeck root of the body before calling a `TypingEnv` constructor, I think it's appropriate to do a more general fix here since I think it's reasonable that other passes might do analysis too. Fixes #141466 r? ```@lcnr``` or ```@oli-obk```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We create a synthetic MIR body for the
AsyncFnOnce
impl for async closures. That body goes through all passes that a regular body does, including promotion.Promotion sometimes requires computing that the type of an rvalue is
Freeze
, which requires computing the typing env of a body. This requires callingopaque_types_defined_by
on the body's def id, which leads to an ICE today since we don't expect that query to be called for synthetic bodies.While we could fix this by, for example, computing the typeck root of the body before calling a
TypingEnv
constructor, I think it's appropriate to do a more general fix here since I think it's reasonable that other passes might do analysis too.Fixes #141466
r? @lcnr or @oli-obk