macros/main: copy fn return to task.
This prevents this bad code from compiling. ```rust async fn main(_spawner: Spawner) -> ! { // not really noreturn! } ```
This commit is contained in:
parent
a614e697d0
commit
e7a19a9725
@ -105,10 +105,11 @@ pub fn run(args: syn::AttributeArgs, f: syn::ItemFn, main: TokenStream) -> Resul
|
|||||||
ctxt.check()?;
|
ctxt.check()?;
|
||||||
|
|
||||||
let f_body = f.block;
|
let f_body = f.block;
|
||||||
|
let out = &f.sig.output;
|
||||||
|
|
||||||
let result = quote! {
|
let result = quote! {
|
||||||
#[::embassy_executor::task()]
|
#[::embassy_executor::task()]
|
||||||
async fn __embassy_main(#fargs) {
|
async fn __embassy_main(#fargs) #out {
|
||||||
#f_body
|
#f_body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user