Skip to content

Commit 7c5c7be

Browse files
committed
Add ui test of async extern fn
1 parent bf1000f commit 7c5c7be

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

tests/ui/async_fn.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[cxx::bridge]
2+
mod ffi {
3+
extern "Rust" {
4+
async fn f();
5+
}
6+
}
7+
8+
async fn f() {}
9+
10+
fn main() {}

tests/ui/async_fn.stderr

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/async_fn.rs:4:18
3+
|
4+
4 | async fn f();
5+
| ^
6+
| |
7+
| expected `()`, found opaque type
8+
| possibly return type missing here?
9+
...
10+
8 | async fn f() {}
11+
| - the `Output` of this `async fn`'s found opaque type
12+
|
13+
= note: expected unit type `()`
14+
found opaque type `impl Future`
15+
help: consider `await`ing on the `Future`
16+
|
17+
4 | async fn f.await();
18+
| ^^^^^^
19+
help: try adding a semicolon
20+
|
21+
4 | async fn f;();
22+
| ^

0 commit comments

Comments
 (0)