File tree Expand file tree Collapse file tree 2 files changed +9
-20
lines changed Expand file tree Collapse file tree 2 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -373,6 +373,12 @@ fn parse_extern_fn(
373373 "variadic function is not supported yet" ,
374374 ) ) ;
375375 }
376+ if foreign_fn. sig . asyncness . is_some ( ) {
377+ return Err ( Error :: new_spanned (
378+ foreign_fn,
379+ "async function is not directly supported yet, but see https://cxx.rs/async.html for a working approach" ,
380+ ) ) ;
381+ }
376382
377383 let mut doc = Doc :: new ( ) ;
378384 let mut cxx_name = None ;
Original file line number Diff line number Diff line change 1- error[E0308]: mismatched types
2- --> $DIR/async_fn.rs:4:18
1+ error: async function is not directly supported yet, but see https://cxx.rs/async.html for a working approach
2+ --> $DIR/async_fn.rs:4:9
33 |
444 | 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- | ^
5+ | ^^^^^^^^^^^^^
You can’t perform that action at this time.
0 commit comments