Skip to content

Commit 42321b0

Browse files
Add test
1 parent a010df9 commit 42321b0

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

src/test/ui/generator/issue-102645.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// compile-flags: -Zdrop-tracking
2+
3+
#![feature(generators, generator_trait)]
4+
5+
use std::ops::Generator;
6+
use std::pin::Pin;
7+
8+
fn main() {
9+
let mut a = 5;
10+
let mut b = || {
11+
let d = 6;
12+
yield;
13+
_zzz(); // #break
14+
a = d;
15+
};
16+
Pin::new(&mut b).resume();
17+
//~^ ERROR this function takes 1 argument but 0 arguments were supplied
18+
// This type error is required to reproduce the ICE...
19+
}
20+
21+
fn _zzz() {
22+
()
23+
}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0061]: this function takes 1 argument but 0 arguments were supplied
2+
--> $DIR/issue-102645.rs:16:22
3+
|
4+
LL | Pin::new(&mut b).resume();
5+
| ^^^^^^-- an argument of type `()` is missing
6+
|
7+
note: associated function defined here
8+
--> $SRC_DIR/core/src/ops/generator.rs:LL:COL
9+
|
10+
LL | fn resume(self: Pin<&mut Self>, arg: R) -> GeneratorState<Self::Yield, Self::Return>;
11+
| ^^^^^^
12+
help: provide the argument
13+
|
14+
LL | Pin::new(&mut b).resume(());
15+
| ~~~~
16+
17+
error: aborting due to previous error
18+
19+
For more information about this error, try `rustc --explain E0061`.

0 commit comments

Comments
 (0)