coroutines: Skip the closure signature annotation check for tainted bodies#155218
Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom Apr 14, 2026
Merged
coroutines: Skip the closure signature annotation check for tainted bodies#155218rust-bors[bot] merged 2 commits intorust-lang:mainfrom
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
Conversation
Collaborator
|
This PR changes a file inside |
Collaborator
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
|
r? tiif |
tiif
reviewed
Apr 13, 2026
Member
|
Other than a nit, it looks good, thanks! Could you also squash the commits? @rustbot author |
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
Contributor
Author
This comment has been minimized.
This comment has been minimized.
When a coroutine has too many parameters, `check_match` fails and `construct_error` builds a MIR body with only the coroutine's computed args (env + resume type). The user-provided signature, however, still reflects all the parameters the user wrote. `check_signature_annotation` then tries to `zip_eq` these two mismatched iterators, causing a panic. Checking `tainted_by_errors` and bailing early avoids this, since `construct_error` bodies cannot meaningfully be compared against user annotations.
aaa0a5d to
d14be60
Compare
Member
|
thanks! @bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Apr 14, 2026
coroutines: Skip the closure signature annotation check for tainted bodies
When a coroutine has too many parameters, `check_match` fails and `construct_error` builds a MIR body with only the coroutine's computed arguments (env + resume type). The user-provided signature, however, still reflects all the parameters the user wrote. `check_signature_annotation` then tries to `zip_eq` these two mismatched iterators, causing a panic. Checking `tainted_by_errors` and bailing early avoids this, since `construct_error` bodies cannot meaningfully be compared against user annotations.
Example currently ICEing:
```rust
fn main() {
|(1, 42), ()| yield;
}
```
Closes rust-lang#139570.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Apr 14, 2026
coroutines: Skip the closure signature annotation check for tainted bodies
When a coroutine has too many parameters, `check_match` fails and `construct_error` builds a MIR body with only the coroutine's computed arguments (env + resume type). The user-provided signature, however, still reflects all the parameters the user wrote. `check_signature_annotation` then tries to `zip_eq` these two mismatched iterators, causing a panic. Checking `tainted_by_errors` and bailing early avoids this, since `construct_error` bodies cannot meaningfully be compared against user annotations.
Example currently ICEing:
```rust
fn main() {
|(1, 42), ()| yield;
}
```
Closes rust-lang#139570.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Apr 14, 2026
coroutines: Skip the closure signature annotation check for tainted bodies
When a coroutine has too many parameters, `check_match` fails and `construct_error` builds a MIR body with only the coroutine's computed arguments (env + resume type). The user-provided signature, however, still reflects all the parameters the user wrote. `check_signature_annotation` then tries to `zip_eq` these two mismatched iterators, causing a panic. Checking `tainted_by_errors` and bailing early avoids this, since `construct_error` bodies cannot meaningfully be compared against user annotations.
Example currently ICEing:
```rust
fn main() {
|(1, 42), ()| yield;
}
```
Closes rust-lang#139570.
rust-bors Bot
pushed a commit
that referenced
this pull request
Apr 14, 2026
…uwer Rollup of 7 pull requests Successful merges: - #154049 (delegation: Track more precise spans for glob delegations) - #155134 (Replace custom trim_ascii_start with the standard library method) - #155235 (add the `fma4` x86 target feature) - #155218 (coroutines: Skip the closure signature annotation check for tainted bodies) - #155274 (limit duplicate-profiler-builtins test to targets that can do dynamic linking) - #155276 (`#[rustc_must_match_exhaustively]` detect let else) - #155281 (Revert "allow `windows-gnu` targets to embed gdb visualizer scripts")
rust-timer
added a commit
that referenced
this pull request
Apr 14, 2026
Rollup merge of #155218 - jakubadamw:issue-139570, r=tiif coroutines: Skip the closure signature annotation check for tainted bodies When a coroutine has too many parameters, `check_match` fails and `construct_error` builds a MIR body with only the coroutine's computed arguments (env + resume type). The user-provided signature, however, still reflects all the parameters the user wrote. `check_signature_annotation` then tries to `zip_eq` these two mismatched iterators, causing a panic. Checking `tainted_by_errors` and bailing early avoids this, since `construct_error` bodies cannot meaningfully be compared against user annotations. Example currently ICEing: ```rust fn main() { |(1, 42), ()| yield; } ``` Closes #139570.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a coroutine has too many parameters,
check_matchfails andconstruct_errorbuilds a MIR body with only the coroutine's computed arguments (env + resume type). The user-provided signature, however, still reflects all the parameters the user wrote.check_signature_annotationthen tries tozip_eqthese two mismatched iterators, causing a panic. Checkingtainted_by_errorsand bailing early avoids this, sinceconstruct_errorbodies cannot meaningfully be compared against user annotations.Example currently ICEing:
Closes #139570.