Require that imported functions must be Send

This commit is contained in:
Mark McCaskey
2020-01-17 15:10:16 -08:00
parent 00082e45be
commit 8c760da83a
2 changed files with 4 additions and 2 deletions

View File

@ -430,7 +430,7 @@ macro_rules! impl_traits {
$( $x: WasmExternType, )*
Rets: WasmTypeList,
Trap: TrapEarly<Rets>,
FN: Fn(&mut vm::Ctx $( , $x )*) -> Trap + 'static,
FN: Fn(&mut vm::Ctx $( , $x )*) -> Trap + 'static + Send,
{
#[allow(non_snake_case)]
fn to_raw(self) -> (NonNull<vm::Func>, Option<NonNull<vm::FuncEnv>>) {
@ -545,7 +545,7 @@ macro_rules! impl_traits {
$( $x: WasmExternType, )*
Rets: WasmTypeList,
Trap: TrapEarly<Rets>,
FN: Fn($( $x, )*) -> Trap + 'static,
FN: Fn($( $x, )*) -> Trap + 'static + Send,
{
#[allow(non_snake_case)]
fn to_raw(self) -> (NonNull<vm::Func>, Option<NonNull<vm::FuncEnv>>) {