Skip to content

Commit d14be60

Browse files
committed
Convert the regression test for a coroutine ICE from a crash test to an UI test
1 parent 189305e commit d14be60

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

tests/crashes/139570.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/139570>.
2+
//! A coroutine with too many parameters should emit errors without an ICE.
3+
4+
#![feature(coroutines)]
5+
6+
fn main() {
7+
#[coroutine]
8+
|(1, 42), ()| {
9+
//~^ ERROR too many parameters for a coroutine
10+
//~| ERROR refutable pattern in closure argument
11+
yield
12+
};
13+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error[E0628]: too many parameters for a coroutine (expected 0 or 1 parameters)
2+
--> $DIR/too-many-parameters-ice.rs:8:5
3+
|
4+
LL | |(1, 42), ()| {
5+
| ^^^^^^^^^^^^^
6+
7+
error[E0005]: refutable pattern in closure argument
8+
--> $DIR/too-many-parameters-ice.rs:8:6
9+
|
10+
LL | |(1, 42), ()| {
11+
| ^^^^^^^ patterns `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered
12+
|
13+
= note: the matched value is of type `(i32, i32)`
14+
15+
error: aborting due to 2 previous errors
16+
17+
Some errors have detailed explanations: E0005, E0628.
18+
For more information about an error, try `rustc --explain E0005`.

0 commit comments

Comments
 (0)