Skip to content

Commit 1d8efed

Browse files
committed
Add out-of-{async,generators} tests
1 parent 9afdbe6 commit 1d8efed

File tree

4 files changed

+82
-0
lines changed

4 files changed

+82
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// edition: 2021
2+
#![feature(explicit_tail_calls)]
3+
4+
async fn a() {
5+
become b();
6+
//~^ error: mismatched function ABIs
7+
//~| error: mismatched signatures
8+
}
9+
10+
fn b() {}
11+
12+
fn block() -> impl std::future::Future<Output = ()> {
13+
async {
14+
become b();
15+
//~^ error: mismatched function ABIs
16+
//~| error: mismatched signatures
17+
}
18+
}
19+
20+
fn main() {}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
error: mismatched function ABIs
2+
--> $DIR/out-of-async.rs:5:5
3+
|
4+
LL | become b();
5+
| ^^^^^^^^^^
6+
|
7+
= note: `become` requires caller and callee to have the same ABI
8+
= note: caller ABI is `"rust-call"`, while callee ABI is `"Rust"`
9+
10+
error: mismatched signatures
11+
--> $DIR/out-of-async.rs:5:5
12+
|
13+
LL | become b();
14+
| ^^^^^^^^^^
15+
|
16+
= note: `become` requires caller and callee to have matching signatures
17+
= note: caller signature: `extern "rust-call" fn(ResumeTy)`
18+
= note: callee signature: `fn()`
19+
20+
error: mismatched function ABIs
21+
--> $DIR/out-of-async.rs:14:9
22+
|
23+
LL | become b();
24+
| ^^^^^^^^^^
25+
|
26+
= note: `become` requires caller and callee to have the same ABI
27+
= note: caller ABI is `"rust-call"`, while callee ABI is `"Rust"`
28+
29+
error: mismatched signatures
30+
--> $DIR/out-of-async.rs:14:9
31+
|
32+
LL | become b();
33+
| ^^^^^^^^^^
34+
|
35+
= note: `become` requires caller and callee to have matching signatures
36+
= note: caller signature: `extern "rust-call" fn(ResumeTy)`
37+
= note: callee signature: `fn()`
38+
39+
error: aborting due to 4 previous errors
40+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![feature(explicit_tail_calls)]
2+
#![feature(generators)]
3+
4+
fn main() {
5+
let _generator = || {
6+
yield 1;
7+
become f() //~ error: mismatched function ABIs
8+
};
9+
}
10+
11+
fn f() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: mismatched function ABIs
2+
--> $DIR/out-of-generators.rs:7:9
3+
|
4+
LL | become f()
5+
| ^^^^^^^^^^
6+
|
7+
= note: `become` requires caller and callee to have the same ABI
8+
= note: caller ABI is `"rust-call"`, while callee ABI is `"Rust"`
9+
10+
error: aborting due to previous error
11+

0 commit comments

Comments
 (0)