Convert the regression test for a coroutine ICE from a crash test to an UI test

This commit is contained in:
Jacob Adam
2026-04-12 23:22:43 +01:00
parent 189305eda3
commit d14be60b5d
3 changed files with 31 additions and 4 deletions
-4
View File
@@ -1,4 +0,0 @@
//@ known-bug: #139570
fn main() {
|(1, 42), ()| yield;
}
@@ -0,0 +1,13 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/139570>.
//! A coroutine with too many parameters should emit errors without an ICE.
#![feature(coroutines)]
fn main() {
#[coroutine]
|(1, 42), ()| {
//~^ ERROR too many parameters for a coroutine
//~| ERROR refutable pattern in closure argument
yield
};
}
@@ -0,0 +1,18 @@
error[E0628]: too many parameters for a coroutine (expected 0 or 1 parameters)
--> $DIR/too-many-parameters-ice.rs:8:5
|
LL | |(1, 42), ()| {
| ^^^^^^^^^^^^^
error[E0005]: refutable pattern in closure argument
--> $DIR/too-many-parameters-ice.rs:8:6
|
LL | |(1, 42), ()| {
| ^^^^^^^ patterns `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered
|
= note: the matched value is of type `(i32, i32)`
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0005, E0628.
For more information about an error, try `rustc --explain E0005`.