Browse Source
Merge pull request #2785 from bytecodealliance/pch/bugfix_wiggle_wasmtime_async
wiggle-wasmtime: use fully qualified Rc, RefCell in expansion
pull/2788/head
Pat Hickey
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
crates/wiggle/wasmtime/macro/src/lib.rs
|
|
@ -288,7 +288,7 @@ fn generate_func( |
|
|
|
let #name_ident = wasmtime::Func::#wrapper( |
|
|
|
store, |
|
|
|
ctx.clone(), |
|
|
|
move |caller: wasmtime::Caller<'_>, my_ctx: &Rc<RefCell<_>> #(,#arg_decls)*| |
|
|
|
move |caller: wasmtime::Caller<'_>, my_ctx: &std::rc::Rc<std::cell::RefCell<_>> #(,#arg_decls)*| |
|
|
|
-> Box<dyn std::future::Future<Output = Result<#ret_ty, wasmtime::Trap>>> { |
|
|
|
Box::new(async move { Self::#fn_ident(&caller, &mut my_ctx.borrow_mut() #(, #arg_names)*).await }) |
|
|
|
} |
|
|
|