From a7ffb44bbc88145536c49ccf1ea4334838c7549e Mon Sep 17 00:00:00 2001 From: Lachlan Sneff Date: Sat, 12 Jan 2019 22:02:19 -0500 Subject: [PATCH] Rework imports --- lib/clif-backend/src/lib.rs | 8 +- lib/clif-backend/src/resolver.rs | 2 +- lib/runtime/build/spectests.rs | 2 +- lib/runtime/examples/simple/main.rs | 9 +- lib/runtime/examples/test.rs | 7 +- lib/runtime/src/backend.rs | 6 +- lib/runtime/src/backing.rs | 69 ++++--- lib/runtime/src/import.rs | 47 +---- lib/runtime/src/instance.rs | 19 +- lib/runtime/src/lib.rs | 9 +- lib/runtime/src/memory.rs | 7 +- lib/runtime/src/module.rs | 22 +- lib/runtime/src/vm.rs | 22 +- lib/runtime/src/vmcalls.rs | 11 +- lib/runtime/tests/semantics.rs | 4 +- lib/runtime/tests/spectests/_common.rs | 7 +- lib/runtime/tests/spectests/address.rs | 8 +- lib/runtime/tests/spectests/align.rs | 48 ++--- lib/runtime/tests/spectests/binary.rs | 32 +-- lib/runtime/tests/spectests/block.rs | 2 +- lib/runtime/tests/spectests/br.rs | 2 +- lib/runtime/tests/spectests/br_if.rs | 2 +- lib/runtime/tests/spectests/br_table.rs | 2 +- lib/runtime/tests/spectests/break_drop.rs | 2 +- lib/runtime/tests/spectests/call.rs | 2 +- lib/runtime/tests/spectests/call_indirect.rs | 2 +- lib/runtime/tests/spectests/comments.rs | 8 +- lib/runtime/tests/spectests/const_.rs | 56 ++--- lib/runtime/tests/spectests/conversions.rs | 2 +- lib/runtime/tests/spectests/custom.rs | 6 +- lib/runtime/tests/spectests/data.rs | 38 ++-- lib/runtime/tests/spectests/elem.rs | 42 ++-- lib/runtime/tests/spectests/endianness.rs | 2 +- lib/runtime/tests/spectests/exports.rs | 100 ++++----- lib/runtime/tests/spectests/f32_.rs | 2 +- lib/runtime/tests/spectests/f32_bitwise.rs | 2 +- lib/runtime/tests/spectests/f32_cmp.rs | 2 +- lib/runtime/tests/spectests/f64_.rs | 2 +- lib/runtime/tests/spectests/f64_bitwise.rs | 2 +- lib/runtime/tests/spectests/f64_cmp.rs | 2 +- lib/runtime/tests/spectests/fac.rs | 2 +- lib/runtime/tests/spectests/float_exprs.rs | 192 +++++++++--------- lib/runtime/tests/spectests/float_literals.rs | 4 +- lib/runtime/tests/spectests/float_memory.rs | 12 +- lib/runtime/tests/spectests/float_misc.rs | 2 +- lib/runtime/tests/spectests/forward.rs | 2 +- lib/runtime/tests/spectests/func.rs | 6 +- lib/runtime/tests/spectests/func_ptrs.rs | 6 +- lib/runtime/tests/spectests/get_local.rs | 2 +- lib/runtime/tests/spectests/globals.rs | 6 +- lib/runtime/tests/spectests/i32_.rs | 2 +- lib/runtime/tests/spectests/i64_.rs | 2 +- lib/runtime/tests/spectests/if_.rs | 2 +- lib/runtime/tests/spectests/int_exprs.rs | 38 ++-- lib/runtime/tests/spectests/int_literals.rs | 2 +- lib/runtime/tests/spectests/labels.rs | 2 +- lib/runtime/tests/spectests/left_to_right.rs | 2 +- lib/runtime/tests/spectests/loop_.rs | 2 +- lib/runtime/tests/spectests/memory.rs | 14 +- lib/runtime/tests/spectests/memory_grow.rs | 10 +- .../tests/spectests/memory_redundancy.rs | 2 +- lib/runtime/tests/spectests/memory_trap.rs | 4 +- lib/runtime/tests/spectests/nop.rs | 2 +- lib/runtime/tests/spectests/return_.rs | 2 +- lib/runtime/tests/spectests/select.rs | 2 +- lib/runtime/tests/spectests/set_local.rs | 2 +- lib/runtime/tests/spectests/stack.rs | 4 +- lib/runtime/tests/spectests/start.rs | 10 +- lib/runtime/tests/spectests/switch.rs | 2 +- lib/runtime/tests/spectests/tee_local.rs | 2 +- lib/runtime/tests/spectests/traps.rs | 8 +- lib/runtime/tests/spectests/types.rs | 2 +- lib/runtime/tests/spectests/unwind.rs | 2 +- 73 files changed, 477 insertions(+), 496 deletions(-) diff --git a/lib/clif-backend/src/lib.rs b/lib/clif-backend/src/lib.rs index b594be2e8..c053c0b81 100644 --- a/lib/clif-backend/src/lib.rs +++ b/lib/clif-backend/src/lib.rs @@ -8,7 +8,7 @@ use cranelift_codegen::{ settings::{self, Configurable}, }; use target_lexicon::Triple; -use wasmer_runtime::{backend::Compiler, module::Module}; +use wasmer_runtime::{backend::Compiler, module::ModuleInner}; use wasmparser::{self, WasmDecoder}; use self::codegen::converter; @@ -23,8 +23,8 @@ impl CraneliftCompiler { } impl Compiler for CraneliftCompiler { - // Compiles wasm binary to a wasmer module - fn compile(&self, wasm: &[u8]) -> Result { + // Compiles wasm binary to a wasmer module. + fn compile(&self, wasm: &[u8]) -> Result { validate(wasm)?; let isa = get_isa(); @@ -35,7 +35,7 @@ impl Compiler for CraneliftCompiler { let wasmer_module = converter::convert_module(cranelift_module); // Return new wasmer module - Ok(Module::new(wasmer_module)) + Ok(wasmer_module) } } diff --git a/lib/clif-backend/src/resolver.rs b/lib/clif-backend/src/resolver.rs index d5eb3d78d..68fde0bb8 100644 --- a/lib/clif-backend/src/resolver.rs +++ b/lib/clif-backend/src/resolver.rs @@ -177,7 +177,7 @@ impl FuncResolver { impl backend::FuncResolver for FuncResolver { fn get( &self, - _module: &wasmer_runtime::module::Module, + _module: &wasmer_runtime::module::ModuleInner, index: FuncIndex, ) -> Option> { self.lookup(index) diff --git a/lib/runtime/build/spectests.rs b/lib/runtime/build/spectests.rs index e661fc707..7e5397dd6 100644 --- a/lib/runtime/build/spectests.rs +++ b/lib/runtime/build/spectests.rs @@ -272,7 +272,7 @@ fn test_module_{}() {{ let module_str = \"{}\"; let wasm_binary = wat2wasm(module_str.as_bytes()).expect(\"WAST not valid or malformed\"); let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()).expect(\"WASM can't be compiled\"); - module.instantiate(generate_imports()).expect(\"WASM can't be instantiated\") + module.instantiate(&generate_imports()).expect(\"WASM can't be instantiated\") }}\n", self.last_module, // We do this to ident four spaces, so it looks aligned to the function body diff --git a/lib/runtime/examples/simple/main.rs b/lib/runtime/examples/simple/main.rs index 628025aa5..62147434e 100644 --- a/lib/runtime/examples/simple/main.rs +++ b/lib/runtime/examples/simple/main.rs @@ -1,5 +1,4 @@ use hashbrown::HashMap; -use std::rc::Rc; use wabt::wat2wasm; use wasmer_clif_backend::CraneliftCompiler; use wasmer_runtime::{ @@ -31,15 +30,13 @@ fn main() -> Result<(), String> { let mut imports = Imports::new(); imports.register("env", env_namespace); - let imports = Rc::new(imports); - - let inner_instance = inner_module.instantiate(imports)?; + let inner_instance = inner_module.instantiate(&imports)?; let mut outer_imports = Imports::new(); outer_imports.register("env", inner_instance); - let outer_imports = Rc::new(outer_imports); + let outer_module = runtime::compile(EXAMPLE_WASM, &CraneliftCompiler::new())?; - let mut outer_instance = outer_module.instantiate(outer_imports)?; + let mut outer_instance = outer_module.instantiate(&outer_imports)?; let ret = outer_instance.call("main", &[Value::I32(42)])?; println!("ret: {:?}", ret); diff --git a/lib/runtime/examples/test.rs b/lib/runtime/examples/test.rs index 811d648a9..1803ff41e 100644 --- a/lib/runtime/examples/test.rs +++ b/lib/runtime/examples/test.rs @@ -1,4 +1,3 @@ -use std::rc::Rc; use wabt::wat2wasm; use wasmer_clif_backend::CraneliftCompiler; use wasmer_runtime::{import::Imports, Instance}; @@ -9,13 +8,13 @@ fn main() { println!("result: {:?}", result); } -fn generate_imports() -> Rc { +fn generate_imports() -> Imports { // let wasm_binary = wat2wasm(IMPORT_MODULE.as_bytes()).expect("WAST not valid or malformed"); // let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()).expect("WASM can't be compiled"); // let instance = module.instantiate(Rc::new(Imports::new())).expect("WASM can't be instantiated"); let imports = Imports::new(); // imports.register("spectest", instance); - Rc::new(imports) + imports } fn create_module_1() -> Instance { @@ -34,6 +33,6 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/src/backend.rs b/lib/runtime/src/backend.rs index 887e4e7ee..1acac213c 100644 --- a/lib/runtime/src/backend.rs +++ b/lib/runtime/src/backend.rs @@ -1,4 +1,4 @@ -use crate::{module::Module, types::FuncIndex, vm}; +use crate::{module::ModuleInner, types::FuncIndex, vm}; use std::ptr::NonNull; pub use crate::mmap::{Mmap, Protect}; @@ -6,9 +6,9 @@ pub use crate::sig_registry::SigRegistry; pub trait Compiler { /// Compiles a `Module` from WebAssembly binary format - fn compile(&self, wasm: &[u8]) -> Result; + fn compile(&self, wasm: &[u8]) -> Result; } pub trait FuncResolver { - fn get(&self, module: &Module, index: FuncIndex) -> Option>; + fn get(&self, module: &ModuleInner, index: FuncIndex) -> Option>; } diff --git a/lib/runtime/src/backing.rs b/lib/runtime/src/backing.rs index a06cddebc..857ab6ebd 100644 --- a/lib/runtime/src/backing.rs +++ b/lib/runtime/src/backing.rs @@ -1,8 +1,8 @@ use crate::{ export::{Context, Export}, - import::ImportResolver, + import::Imports, memory::LinearMemory, - module::{ImportName, Module}, + module::{ImportName, ModuleInner}, table::{TableBacking, TableElements}, types::{Initializer, MapIndex, Value}, vm, @@ -10,16 +10,26 @@ use crate::{ #[derive(Debug)] pub struct LocalBacking { - pub memories: Box<[LinearMemory]>, - pub tables: Box<[TableBacking]>, + pub(crate) memories: Box<[LinearMemory]>, + pub(crate) tables: Box<[TableBacking]>, - pub vm_memories: Box<[vm::LocalMemory]>, - pub vm_tables: Box<[vm::LocalTable]>, - pub vm_globals: Box<[vm::LocalGlobal]>, + pub(crate) vm_memories: Box<[vm::LocalMemory]>, + pub(crate) vm_tables: Box<[vm::LocalTable]>, + pub(crate) vm_globals: Box<[vm::LocalGlobal]>, } impl LocalBacking { - pub fn new(module: &Module, imports: &ImportBacking, vmctx: *mut vm::Ctx) -> Self { + pub fn memory(&mut self, index: u32) -> &mut LinearMemory { + &mut self.memories[index as usize] + } + + pub fn table(&mut self, index: u32) -> &mut TableBacking { + &mut self.tables[index as usize] + } +} + +impl LocalBacking { + pub(crate) fn new(module: &ModuleInner, imports: &ImportBacking, vmctx: *mut vm::Ctx) -> Self { let mut memories = Self::generate_memories(module); let mut tables = Self::generate_tables(module); let globals = Self::generate_globals(module); @@ -38,7 +48,7 @@ impl LocalBacking { } } - fn generate_memories(module: &Module) -> Box<[LinearMemory]> { + fn generate_memories(module: &ModuleInner) -> Box<[LinearMemory]> { let mut memories = Vec::with_capacity(module.memories.len()); for (_, mem) in &module.memories { @@ -59,7 +69,10 @@ impl LocalBacking { memories.into_boxed_slice() } - fn finalize_memories(module: &Module, memories: &mut [LinearMemory]) -> Box<[vm::LocalMemory]> { + fn finalize_memories( + module: &ModuleInner, + memories: &mut [LinearMemory], + ) -> Box<[vm::LocalMemory]> { for init in &module.data_initializers { assert!(init.base.is_none(), "global base not supported yet"); assert!(init.offset + init.data.len() <= memories[init.memory_index.index()].size()); @@ -82,7 +95,7 @@ impl LocalBacking { .into_boxed_slice() } - fn generate_tables(module: &Module) -> Box<[TableBacking]> { + fn generate_tables(module: &ModuleInner) -> Box<[TableBacking]> { let mut tables = Vec::with_capacity(module.tables.len()); for (_, table) in &module.tables { @@ -94,7 +107,7 @@ impl LocalBacking { } fn finalize_tables( - module: &Module, + module: &ModuleInner, imports: &ImportBacking, tables: &mut [TableBacking], vmctx: *mut vm::Ctx, @@ -134,14 +147,14 @@ impl LocalBacking { .into_boxed_slice() } - fn generate_globals(module: &Module) -> Box<[vm::LocalGlobal]> { + fn generate_globals(module: &ModuleInner) -> Box<[vm::LocalGlobal]> { let globals = vec![vm::LocalGlobal::null(); module.globals.len()]; globals.into_boxed_slice() } fn finalize_globals( - module: &Module, + module: &ModuleInner, imports: &ImportBacking, mut globals: Box<[vm::LocalGlobal]>, ) -> Box<[vm::LocalGlobal]> { @@ -171,8 +184,8 @@ pub struct ImportBacking { impl ImportBacking { pub fn new( - module: &Module, - imports: &dyn ImportResolver, + module: &ModuleInner, + imports: &Imports, vmctx: *mut vm::Ctx, ) -> Result { assert!( @@ -190,15 +203,17 @@ impl ImportBacking { } fn import_memories( - module: &Module, - imports: &dyn ImportResolver, + module: &ModuleInner, + imports: &Imports, vmctx: *mut vm::Ctx, ) -> Result, String> { let mut memories = Vec::with_capacity(module.imported_memories.len()); for (_index, (ImportName { namespace, name }, expected_memory_desc)) in &module.imported_memories { - let memory_import = imports.get(namespace, name); + let memory_import = imports + .get_namespace(namespace) + .and_then(|namespace| namespace.get_export(name)); match memory_import { Some(Export::Memory { local, @@ -232,15 +247,17 @@ fn import_memories( } fn import_functions( - module: &Module, - imports: &dyn ImportResolver, + module: &ModuleInner, + imports: &Imports, vmctx: *mut vm::Ctx, ) -> Result, String> { let mut functions = Vec::with_capacity(module.imported_functions.len()); for (index, ImportName { namespace, name }) in &module.imported_functions { let sig_index = module.func_assoc[index]; let expected_sig = module.sig_registry.lookup_func_sig(sig_index); - let import = imports.get(namespace, name); + let import = imports + .get_namespace(namespace) + .and_then(|namespace| namespace.get_export(name)); match import { Some(Export::Function { func, @@ -274,12 +291,14 @@ fn import_functions( } fn import_globals( - module: &Module, - imports: &dyn ImportResolver, + module: &ModuleInner, + imports: &Imports, ) -> Result, String> { let mut globals = Vec::with_capacity(module.imported_globals.len()); for (_, (ImportName { namespace, name }, global_desc)) in &module.imported_globals { - let import = imports.get(namespace, name); + let import = imports + .get_namespace(namespace) + .and_then(|namespace| namespace.get_export(name)); match import { Some(Export::Global { local, global }) => { if &global == global_desc { diff --git a/lib/runtime/src/import.rs b/lib/runtime/src/import.rs index 90a26e874..d2e12c5a2 100644 --- a/lib/runtime/src/import.rs +++ b/lib/runtime/src/import.rs @@ -1,10 +1,6 @@ use crate::export::Export; use hashbrown::{hash_map::Entry, HashMap}; -pub trait ImportResolver { - fn get(&self, namespace: &str, name: &str) -> Option; -} - pub trait Namespace { fn get_export(&self, name: &str) -> Option; } @@ -31,11 +27,11 @@ impl Imports { } } - pub fn register( - &mut self, - name: impl Into, - namespace: impl Namespace + 'static, - ) -> Option> { + pub fn register(&mut self, name: S, namespace: N) -> Option> + where + S: Into, + N: Namespace + 'static, + { match self.map.entry(name.into()) { Entry::Vacant(empty) => { empty.insert(Box::new(namespace)); @@ -45,36 +41,7 @@ impl Imports { } } - // pub fn register_instance(&mut self, namespace: impl Into, instance: Box) { - // match self.map.entry(namespace.into()) { - // Entry::Vacant(empty) => empty.insert(Namespace::Instance(instance)), - // Entry::Occupied(_) => { - // panic!("cannot register an instance in a namespace that already exists") - // } - // }; - // } - - // pub fn register_export( - // &mut self, - // namespace: impl Into, - // name: impl Into, - // export: Export, - // ) { - // let namespace_item = self - // .map - // .entry(namespace.into()) - // .or_insert_with(|| Namespace::UserSupplied(HashMap::new())); - - // match namespace_item { - // Namespace::UserSupplied(ref mut map) => map.insert(name.into(), export), - // Namespace::Instance(_) => panic!("cannot register an export in a namespace that has already been used to register an instance"), - // }; - // } -} - -impl ImportResolver for Imports { - fn get(&self, namespace_name: &str, name: &str) -> Option { - let namespace = self.map.get(namespace_name)?; - namespace.get_export(name) + pub fn get_namespace(&self, namespace: &str) -> Option<&dyn Namespace> { + self.map.get(namespace).map(|namespace| &**namespace) } } diff --git a/lib/runtime/src/instance.rs b/lib/runtime/src/instance.rs index bac32b2c7..ba15d43cd 100644 --- a/lib/runtime/src/instance.rs +++ b/lib/runtime/src/instance.rs @@ -2,8 +2,8 @@ use crate::recovery::call_protected; use crate::{ backing::{ImportBacking, LocalBacking}, export::{Context, Export, ExportIter, FuncPointer, MemoryPointer}, - import::{ImportResolver, Namespace}, - module::{ExportIndex, Module}, + import::{Imports, Namespace}, + module::{ExportIndex, Module, ModuleInner}, types::{FuncIndex, FuncSig, MapIndex, Memory, MemoryIndex, Type, Value}, vm, }; @@ -14,19 +14,17 @@ use std::{iter, mem}; struct InstanceInner { #[allow(dead_code)] pub(crate) backing: LocalBacking, - #[allow(dead_code)] - imports: Rc, import_backing: ImportBacking, vmctx: Box, } pub struct Instance { - pub module: Module, + pub(crate) module: Rc, inner: Box, } impl Instance { - pub(crate) fn new(module: Module, imports: Rc) -> Result { + pub(crate) fn new(module: Rc, imports: &Imports) -> Result { // We need the backing and import_backing to create a vm::Ctx, but we need // a vm::Ctx to create a backing and an import_backing. The solution is to create an // uninitialized vm::Ctx and then initialize it in-place. @@ -38,16 +36,13 @@ impl Instance { // When Pin is stablized, this will use `Box::pinned` instead of `Box::new`. let mut inner = Box::new(InstanceInner { backing, - imports, import_backing, vmctx, }); // Initialize the vm::Ctx in-place after the backing // has been boxed. - *inner.vmctx = unsafe { - vm::Ctx::new(&mut inner.backing, &mut inner.import_backing) - }; + *inner.vmctx = unsafe { vm::Ctx::new(&mut inner.backing, &mut inner.import_backing) }; let mut instance = Instance { module, inner }; @@ -83,6 +78,10 @@ impl Instance { pub fn exports(&self) -> ExportIter { ExportIter::new(self) } + + pub fn module(&self) -> Module { + Module::new(Rc::clone(&self.module)) + } } impl Instance { diff --git a/lib/runtime/src/lib.rs b/lib/runtime/src/lib.rs index 1b12075a0..d3bb1b63b 100644 --- a/lib/runtime/src/lib.rs +++ b/lib/runtime/src/lib.rs @@ -4,6 +4,7 @@ extern crate field_offset; #[macro_use] mod macros; +#[doc(hidden)] pub mod backend; mod backing; pub mod export; @@ -18,11 +19,17 @@ mod sighandler; pub mod table; pub mod types; pub mod vm; +#[doc(hidden)] pub mod vmcalls; pub use self::instance::Instance; +#[doc(inline)] +pub use self::module::Module; +use std::rc::Rc; /// Compile a webassembly module using the provided compiler. pub fn compile(wasm: &[u8], compiler: &dyn backend::Compiler) -> Result { - compiler.compile(wasm) + compiler + .compile(wasm) + .map(|inner| module::Module::new(Rc::new(inner))) } diff --git a/lib/runtime/src/memory.rs b/lib/runtime/src/memory.rs index 638a0be8e..589b6f3bd 100644 --- a/lib/runtime/src/memory.rs +++ b/lib/runtime/src/memory.rs @@ -1,8 +1,3 @@ -//! The webassembly::Memory() constructor creates a new Memory object which is -//! a structure that holds the raw bytes of memory accessed by a -//! webassembly::Instance. -//! A memory created by Rust or in WebAssembly code will be accessible and -//! mutable from both Rust and WebAssembly. use std::ops::{Deref, DerefMut}; use crate::{ @@ -40,7 +35,9 @@ pub struct LinearMemory { impl LinearMemory { pub(crate) const PAGE_SIZE: u32 = 65_536; pub(crate) const MAX_PAGES: u32 = 65_536; + #[doc(hidden)] pub const DEFAULT_HEAP_SIZE: usize = 1 << 32; // 4 GiB + #[doc(hidden)] pub const DEFAULT_GUARD_SIZE: usize = 1 << 31; // 2 GiB pub(crate) const DEFAULT_SIZE: usize = Self::DEFAULT_HEAP_SIZE + Self::DEFAULT_GUARD_SIZE; // 6 GiB diff --git a/lib/runtime/src/module.rs b/lib/runtime/src/module.rs index ce2f41d01..312c4367d 100644 --- a/lib/runtime/src/module.rs +++ b/lib/runtime/src/module.rs @@ -1,6 +1,6 @@ use crate::{ backend::FuncResolver, - import::ImportResolver, + import::Imports, sig_registry::SigRegistry, types::{ FuncIndex, Global, GlobalDesc, GlobalIndex, Map, MapIndex, Memory, MemoryIndex, SigIndex, @@ -9,10 +9,10 @@ use crate::{ Instance, }; use hashbrown::HashMap; -use std::ops::Deref; use std::rc::Rc; /// This is used to instantiate a new webassembly module. +#[doc(hidden)] pub struct ModuleInner { pub func_resolver: Box, pub memories: Map, @@ -37,14 +37,13 @@ pub struct ModuleInner { pub struct Module(Rc); impl Module { - #[inline] - pub fn new(inner: ModuleInner) -> Self { - Module(Rc::new(inner)) + pub(crate) fn new(inner: Rc) -> Self { + Module(inner) } /// Instantiate a webassembly module with the provided imports. - pub fn instantiate(&self, imports: Rc) -> Result { - Instance::new(Module(Rc::clone(&self.0)), imports) + pub fn instantiate(&self, imports: &Imports) -> Result { + Instance::new(Rc::clone(&self.0), imports) } } @@ -58,14 +57,7 @@ impl ModuleInner { } } -impl Deref for Module { - type Target = ModuleInner; - - fn deref(&self) -> &ModuleInner { - &*self.0 - } -} - +#[doc(hidden)] #[derive(Debug, Clone)] pub struct ImportName { pub namespace: String, diff --git a/lib/runtime/src/vm.rs b/lib/runtime/src/vm.rs index 3a445f3fc..290b0b7dd 100644 --- a/lib/runtime/src/vm.rs +++ b/lib/runtime/src/vm.rs @@ -1,36 +1,40 @@ -use crate::backing::{ImportBacking, LocalBacking}; +use crate::backing::ImportBacking; +pub use crate::backing::LocalBacking; use std::{mem, ptr}; #[derive(Debug)] #[repr(C)] pub struct Ctx { /// A pointer to an array of locally-defined memories, indexed by `MemoryIndex`. - pub memories: *mut LocalMemory, + pub(crate) memories: *mut LocalMemory, /// A pointer to an array of locally-defined tables, indexed by `TableIndex`. - pub tables: *mut LocalTable, + pub(crate) tables: *mut LocalTable, /// A pointer to an array of locally-defined globals, indexed by `GlobalIndex`. - pub globals: *mut LocalGlobal, + pub(crate) globals: *mut LocalGlobal, /// A pointer to an array of imported memories, indexed by `MemoryIndex, - pub imported_memories: *mut ImportedMemory, + pub(crate) imported_memories: *mut ImportedMemory, /// A pointer to an array of imported tables, indexed by `TableIndex`. - pub imported_tables: *mut ImportedTable, + pub(crate) imported_tables: *mut ImportedTable, /// A pointer to an array of imported globals, indexed by `GlobalIndex`. - pub imported_globals: *mut ImportedGlobal, + pub(crate) imported_globals: *mut ImportedGlobal, /// A pointer to an array of imported functions, indexed by `FuncIndex`. - pub imported_funcs: *mut ImportedFunc, + pub(crate) imported_funcs: *mut ImportedFunc, /// The parent instance. pub local_backing: *mut LocalBacking, } impl Ctx { - pub unsafe fn new(local_backing: &mut LocalBacking, import_backing: &mut ImportBacking) -> Self { + pub unsafe fn new( + local_backing: &mut LocalBacking, + import_backing: &mut ImportBacking, + ) -> Self { Self { memories: local_backing.vm_memories.as_mut_ptr(), tables: local_backing.vm_tables.as_mut_ptr(), diff --git a/lib/runtime/src/vmcalls.rs b/lib/runtime/src/vmcalls.rs index a41a43137..838356d97 100644 --- a/lib/runtime/src/vmcalls.rs +++ b/lib/runtime/src/vmcalls.rs @@ -5,7 +5,9 @@ pub unsafe extern "C" fn memory_grow_static( by_pages: u32, ctx: *mut vm::Ctx, ) -> i32 { - if let Some(old) = (*(*ctx).local_backing).memories[memory_index as usize].grow_static(by_pages) + if let Some(old) = (*(*ctx).local_backing) + .memory(memory_index) + .grow_static(by_pages) { // Store the new size back into the vmctx. (*(*ctx).memories.add(memory_index as usize)).size = @@ -17,7 +19,7 @@ pub unsafe extern "C" fn memory_grow_static( } pub unsafe extern "C" fn memory_size(memory_index: u32, ctx: *mut vm::Ctx) -> u32 { - (*(*ctx).local_backing).memories[memory_index as usize].pages() + (*(*ctx).local_backing).memory(memory_index).pages() } pub unsafe extern "C" fn memory_grow_dynamic( @@ -25,8 +27,9 @@ pub unsafe extern "C" fn memory_grow_dynamic( by_pages: u32, ctx: *mut vm::Ctx, ) -> i32 { - if let Some(old) = - (*(*ctx).local_backing).memories[memory_index as usize].grow_dynamic(by_pages) + if let Some(old) = (*(*ctx).local_backing) + .memory(memory_index) + .grow_dynamic(by_pages) { // Store the new size back into the vmctx. (*(*ctx).memories.add(memory_index as usize)).size = diff --git a/lib/runtime/tests/semantics.rs b/lib/runtime/tests/semantics.rs index 999306b0b..52ed30fb3 100644 --- a/lib/runtime/tests/semantics.rs +++ b/lib/runtime/tests/semantics.rs @@ -1,7 +1,5 @@ #[cfg(test)] mod tests { - - use std::rc::Rc; use wabt::wat2wasm; use wasmer_clif_backend::CraneliftCompiler; use wasmer_runtime::import::Imports; @@ -24,7 +22,7 @@ mod tests { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); let mut instance = module - .instantiate(Rc::new(Imports::new())) + .instantiate(&Imports::new()) .expect("WASM can't be instantiated"); let result = instance.call("stack-overflow", &[]); assert!( diff --git a/lib/runtime/tests/spectests/_common.rs b/lib/runtime/tests/spectests/_common.rs index 9ecb528d9..2681a30df 100644 --- a/lib/runtime/tests/spectests/_common.rs +++ b/lib/runtime/tests/spectests/_common.rs @@ -1,4 +1,3 @@ -use std::rc::Rc; use wabt::wat2wasm; use wasmer_clif_backend::CraneliftCompiler; use wasmer_runtime::import::Imports; @@ -14,16 +13,16 @@ static IMPORT_MODULE: &str = r#" (global $global_i32 (export "global_i32") i32 (i32.const 666))) "#; -pub fn generate_imports() -> Rc { +pub fn generate_imports() -> Imports { let wasm_binary = wat2wasm(IMPORT_MODULE.as_bytes()).expect("WAST not valid or malformed"); let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); let instance = module - .instantiate(Rc::new(Imports::new())) + .instantiate(&Imports::new()) .expect("WASM can't be instantiated"); let mut imports = Imports::new(); imports.register("spectest", instance); - Rc::new(imports) + imports } /// Bit pattern of an f32 value: diff --git a/lib/runtime/tests/spectests/address.rs b/lib/runtime/tests/spectests/address.rs index 4b962c6f6..70862649f 100644 --- a/lib/runtime/tests/spectests/address.rs +++ b/lib/runtime/tests/spectests/address.rs @@ -151,7 +151,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1201,7 +1201,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -2415,7 +2415,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -2648,7 +2648,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/align.rs b/lib/runtime/tests/spectests/align.rs index ed642376a..f4bd576cd 100644 --- a/lib/runtime/tests/spectests/align.rs +++ b/lib/runtime/tests/spectests/align.rs @@ -28,7 +28,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -58,7 +58,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -88,7 +88,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -118,7 +118,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -148,7 +148,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -178,7 +178,7 @@ fn create_module_6() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -208,7 +208,7 @@ fn create_module_7() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -238,7 +238,7 @@ fn create_module_8() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -268,7 +268,7 @@ fn create_module_9() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -298,7 +298,7 @@ fn create_module_10() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -328,7 +328,7 @@ fn create_module_11() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -358,7 +358,7 @@ fn create_module_12() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -388,7 +388,7 @@ fn create_module_13() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -418,7 +418,7 @@ fn create_module_14() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -448,7 +448,7 @@ fn create_module_15() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -478,7 +478,7 @@ fn create_module_16() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -508,7 +508,7 @@ fn create_module_17() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -538,7 +538,7 @@ fn create_module_18() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -568,7 +568,7 @@ fn create_module_19() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -598,7 +598,7 @@ fn create_module_20() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -628,7 +628,7 @@ fn create_module_21() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -658,7 +658,7 @@ fn create_module_22() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -688,7 +688,7 @@ fn create_module_23() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -2420,7 +2420,7 @@ fn create_module_24() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/binary.rs b/lib/runtime/tests/spectests/binary.rs index 5fd62c7d3..7ff03daf2 100644 --- a/lib/runtime/tests/spectests/binary.rs +++ b/lib/runtime/tests/spectests/binary.rs @@ -22,7 +22,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -46,7 +46,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -70,7 +70,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -94,7 +94,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -427,7 +427,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -452,7 +452,7 @@ fn create_module_6() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -477,7 +477,7 @@ fn create_module_7() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -502,7 +502,7 @@ fn create_module_8() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -527,7 +527,7 @@ fn create_module_9() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -552,7 +552,7 @@ fn create_module_10() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -577,7 +577,7 @@ fn create_module_11() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -602,7 +602,7 @@ fn create_module_12() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -627,7 +627,7 @@ fn create_module_13() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -652,7 +652,7 @@ fn create_module_14() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -678,7 +678,7 @@ fn create_module_15() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -704,7 +704,7 @@ fn create_module_16() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/block.rs b/lib/runtime/tests/spectests/block.rs index 3ef053b3f..fb2ad5a14 100644 --- a/lib/runtime/tests/spectests/block.rs +++ b/lib/runtime/tests/spectests/block.rs @@ -535,7 +535,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/br.rs b/lib/runtime/tests/spectests/br.rs index f78b7cb40..d219b17b1 100644 --- a/lib/runtime/tests/spectests/br.rs +++ b/lib/runtime/tests/spectests/br.rs @@ -567,7 +567,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/br_if.rs b/lib/runtime/tests/spectests/br_if.rs index b2a676303..8937f49b6 100644 --- a/lib/runtime/tests/spectests/br_if.rs +++ b/lib/runtime/tests/spectests/br_if.rs @@ -579,7 +579,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/br_table.rs b/lib/runtime/tests/spectests/br_table.rs index 7f821cab0..d53d38f91 100644 --- a/lib/runtime/tests/spectests/br_table.rs +++ b/lib/runtime/tests/spectests/br_table.rs @@ -786,7 +786,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/break_drop.rs b/lib/runtime/tests/spectests/break_drop.rs index a2472e5cb..f656cb375 100644 --- a/lib/runtime/tests/spectests/break_drop.rs +++ b/lib/runtime/tests/spectests/break_drop.rs @@ -40,7 +40,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/call.rs b/lib/runtime/tests/spectests/call.rs index a103dbddf..39db34951 100644 --- a/lib/runtime/tests/spectests/call.rs +++ b/lib/runtime/tests/spectests/call.rs @@ -321,7 +321,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/call_indirect.rs b/lib/runtime/tests/spectests/call_indirect.rs index bf86fb670..ce685557f 100644 --- a/lib/runtime/tests/spectests/call_indirect.rs +++ b/lib/runtime/tests/spectests/call_indirect.rs @@ -517,7 +517,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/comments.rs b/lib/runtime/tests/spectests/comments.rs index 144c2ed19..a59d9f0fc 100644 --- a/lib/runtime/tests/spectests/comments.rs +++ b/lib/runtime/tests/spectests/comments.rs @@ -22,7 +22,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -46,7 +46,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -70,7 +70,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -94,7 +94,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/const_.rs b/lib/runtime/tests/spectests/const_.rs index 40ff6301c..6f02fe802 100644 --- a/lib/runtime/tests/spectests/const_.rs +++ b/lib/runtime/tests/spectests/const_.rs @@ -26,7 +26,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -54,7 +54,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -110,7 +110,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -138,7 +138,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -194,7 +194,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -222,7 +222,7 @@ fn create_module_6() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -280,7 +280,7 @@ fn create_module_7() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -308,7 +308,7 @@ fn create_module_8() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -366,7 +366,7 @@ fn create_module_9() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -394,7 +394,7 @@ fn create_module_10() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -422,7 +422,7 @@ fn create_module_11() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -450,7 +450,7 @@ fn create_module_12() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -478,7 +478,7 @@ fn create_module_13() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -506,7 +506,7 @@ fn create_module_14() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -590,7 +590,7 @@ fn create_module_15() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -618,7 +618,7 @@ fn create_module_16() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -674,7 +674,7 @@ fn create_module_17() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -702,7 +702,7 @@ fn create_module_18() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -760,7 +760,7 @@ fn create_module_19() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -788,7 +788,7 @@ fn create_module_20() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -816,7 +816,7 @@ fn create_module_21() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -844,7 +844,7 @@ fn create_module_22() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -872,7 +872,7 @@ fn create_module_23() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -900,7 +900,7 @@ fn create_module_24() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -986,7 +986,7 @@ fn create_module_25() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1014,7 +1014,7 @@ fn create_module_26() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1070,7 +1070,7 @@ fn create_module_27() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1098,7 +1098,7 @@ fn create_module_28() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/conversions.rs b/lib/runtime/tests/spectests/conversions.rs index 8c161b37c..21553d1e2 100644 --- a/lib/runtime/tests/spectests/conversions.rs +++ b/lib/runtime/tests/spectests/conversions.rs @@ -134,7 +134,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/custom.rs b/lib/runtime/tests/spectests/custom.rs index 7ebb4ac10..368474235 100644 --- a/lib/runtime/tests/spectests/custom.rs +++ b/lib/runtime/tests/spectests/custom.rs @@ -22,7 +22,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -46,7 +46,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -76,7 +76,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/data.rs b/lib/runtime/tests/spectests/data.rs index 054cbef8d..67f676ad1 100644 --- a/lib/runtime/tests/spectests/data.rs +++ b/lib/runtime/tests/spectests/data.rs @@ -35,7 +35,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -61,7 +61,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -87,7 +87,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -117,7 +117,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -148,7 +148,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -175,7 +175,7 @@ fn create_module_6() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -202,7 +202,7 @@ fn create_module_7() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -228,7 +228,7 @@ fn create_module_8() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -254,7 +254,7 @@ fn create_module_9() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -280,7 +280,7 @@ fn create_module_10() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -306,7 +306,7 @@ fn create_module_11() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -332,7 +332,7 @@ fn create_module_12() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -358,7 +358,7 @@ fn create_module_13() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -384,7 +384,7 @@ fn create_module_14() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -410,7 +410,7 @@ fn create_module_15() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -436,7 +436,7 @@ fn create_module_16() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -462,7 +462,7 @@ fn create_module_17() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -488,7 +488,7 @@ fn create_module_18() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -514,7 +514,7 @@ fn create_module_19() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/elem.rs b/lib/runtime/tests/spectests/elem.rs index 1801fdb7e..19c518a4c 100644 --- a/lib/runtime/tests/spectests/elem.rs +++ b/lib/runtime/tests/spectests/elem.rs @@ -37,7 +37,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -65,7 +65,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -93,7 +93,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -125,7 +125,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -157,7 +157,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -186,7 +186,7 @@ fn create_module_6() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -215,7 +215,7 @@ fn create_module_7() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -255,7 +255,7 @@ fn create_module_8() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -301,7 +301,7 @@ fn create_module_9() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -329,7 +329,7 @@ fn create_module_10() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -355,7 +355,7 @@ fn create_module_11() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -381,7 +381,7 @@ fn create_module_12() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -407,7 +407,7 @@ fn create_module_13() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -433,7 +433,7 @@ fn create_module_14() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -461,7 +461,7 @@ fn create_module_15() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -489,7 +489,7 @@ fn create_module_16() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -517,7 +517,7 @@ fn create_module_17() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -545,7 +545,7 @@ fn create_module_18() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -666,7 +666,7 @@ fn create_module_19() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -711,7 +711,7 @@ fn create_module_20() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -765,7 +765,7 @@ fn create_module_21() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/endianness.rs b/lib/runtime/tests/spectests/endianness.rs index 03a5cc25c..7bc8f7a2f 100644 --- a/lib/runtime/tests/spectests/endianness.rs +++ b/lib/runtime/tests/spectests/endianness.rs @@ -226,7 +226,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/exports.rs b/lib/runtime/tests/spectests/exports.rs index 34393536f..646db759d 100644 --- a/lib/runtime/tests/spectests/exports.rs +++ b/lib/runtime/tests/spectests/exports.rs @@ -25,7 +25,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -53,7 +53,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -82,7 +82,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -109,7 +109,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -138,7 +138,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -166,7 +166,7 @@ fn create_module_6() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -193,7 +193,7 @@ fn create_module_7() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -220,7 +220,7 @@ fn create_module_8() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -247,7 +247,7 @@ fn create_module_9() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -274,7 +274,7 @@ fn create_module_10() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -301,7 +301,7 @@ fn create_module_11() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -332,7 +332,7 @@ fn create_module_12() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -442,7 +442,7 @@ fn create_module_13() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -469,7 +469,7 @@ fn create_module_14() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -497,7 +497,7 @@ fn create_module_15() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -523,7 +523,7 @@ fn create_module_16() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -549,7 +549,7 @@ fn create_module_17() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -575,7 +575,7 @@ fn create_module_18() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -601,7 +601,7 @@ fn create_module_19() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -627,7 +627,7 @@ fn create_module_20() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -653,7 +653,7 @@ fn create_module_21() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -679,7 +679,7 @@ fn create_module_22() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -773,7 +773,7 @@ fn create_module_23() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -800,7 +800,7 @@ fn create_module_24() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -826,7 +826,7 @@ fn create_module_25() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -852,7 +852,7 @@ fn create_module_26() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -878,7 +878,7 @@ fn create_module_27() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -904,7 +904,7 @@ fn create_module_28() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -930,7 +930,7 @@ fn create_module_29() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -956,7 +956,7 @@ fn create_module_30() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -982,7 +982,7 @@ fn create_module_31() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1008,7 +1008,7 @@ fn create_module_32() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1034,7 +1034,7 @@ fn create_module_33() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1060,7 +1060,7 @@ fn create_module_34() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1086,7 +1086,7 @@ fn create_module_35() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1112,7 +1112,7 @@ fn create_module_36() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1191,7 +1191,7 @@ fn create_module_37() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1218,7 +1218,7 @@ fn create_module_38() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1244,7 +1244,7 @@ fn create_module_39() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1270,7 +1270,7 @@ fn create_module_40() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1296,7 +1296,7 @@ fn create_module_41() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1322,7 +1322,7 @@ fn create_module_42() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1348,7 +1348,7 @@ fn create_module_43() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1374,7 +1374,7 @@ fn create_module_44() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1400,7 +1400,7 @@ fn create_module_45() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1426,7 +1426,7 @@ fn create_module_46() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1452,7 +1452,7 @@ fn create_module_47() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1478,7 +1478,7 @@ fn create_module_48() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1504,7 +1504,7 @@ fn create_module_49() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1530,7 +1530,7 @@ fn create_module_50() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/f32_.rs b/lib/runtime/tests/spectests/f32_.rs index 181aa7520..a0b9d0971 100644 --- a/lib/runtime/tests/spectests/f32_.rs +++ b/lib/runtime/tests/spectests/f32_.rs @@ -74,7 +74,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/f32_bitwise.rs b/lib/runtime/tests/spectests/f32_bitwise.rs index c50df143b..5de52d1ad 100644 --- a/lib/runtime/tests/spectests/f32_bitwise.rs +++ b/lib/runtime/tests/spectests/f32_bitwise.rs @@ -37,7 +37,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/f32_cmp.rs b/lib/runtime/tests/spectests/f32_cmp.rs index 8b587f8ba..be2f57537 100644 --- a/lib/runtime/tests/spectests/f32_cmp.rs +++ b/lib/runtime/tests/spectests/f32_cmp.rs @@ -53,7 +53,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/f64_.rs b/lib/runtime/tests/spectests/f64_.rs index 17b06a17a..39bee2053 100644 --- a/lib/runtime/tests/spectests/f64_.rs +++ b/lib/runtime/tests/spectests/f64_.rs @@ -74,7 +74,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/f64_bitwise.rs b/lib/runtime/tests/spectests/f64_bitwise.rs index d95dfa19e..94edf0861 100644 --- a/lib/runtime/tests/spectests/f64_bitwise.rs +++ b/lib/runtime/tests/spectests/f64_bitwise.rs @@ -37,7 +37,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/f64_cmp.rs b/lib/runtime/tests/spectests/f64_cmp.rs index e81124cfc..fe7151c9d 100644 --- a/lib/runtime/tests/spectests/f64_cmp.rs +++ b/lib/runtime/tests/spectests/f64_cmp.rs @@ -53,7 +53,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/fac.rs b/lib/runtime/tests/spectests/fac.rs index 99743eb75..66a137291 100644 --- a/lib/runtime/tests/spectests/fac.rs +++ b/lib/runtime/tests/spectests/fac.rs @@ -135,7 +135,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/float_exprs.rs b/lib/runtime/tests/spectests/float_exprs.rs index d49331c30..f67d90713 100644 --- a/lib/runtime/tests/spectests/float_exprs.rs +++ b/lib/runtime/tests/spectests/float_exprs.rs @@ -30,7 +30,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -123,7 +123,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -290,7 +290,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -386,7 +386,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -482,7 +482,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -560,7 +560,7 @@ fn create_module_6() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -692,7 +692,7 @@ fn create_module_7() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -770,7 +770,7 @@ fn create_module_8() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -962,7 +962,7 @@ fn create_module_9() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1040,7 +1040,7 @@ fn create_module_10() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1118,7 +1118,7 @@ fn create_module_11() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1196,7 +1196,7 @@ fn create_module_12() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1274,7 +1274,7 @@ fn create_module_13() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1334,7 +1334,7 @@ fn create_module_14() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1394,7 +1394,7 @@ fn create_module_15() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1508,7 +1508,7 @@ fn create_module_16() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1694,7 +1694,7 @@ fn create_module_17() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1866,7 +1866,7 @@ fn create_module_18() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -2047,7 +2047,7 @@ fn create_module_19() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -2228,7 +2228,7 @@ fn create_module_20() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -2412,7 +2412,7 @@ fn create_module_21() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -2597,7 +2597,7 @@ fn create_module_22() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -2774,7 +2774,7 @@ fn create_module_23() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -2951,7 +2951,7 @@ fn create_module_24() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -3215,7 +3215,7 @@ fn create_module_25() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -3489,7 +3489,7 @@ fn create_module_26() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -3648,7 +3648,7 @@ fn create_module_27() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -3760,7 +3760,7 @@ fn create_module_28() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -3917,7 +3917,7 @@ fn create_module_29() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -4023,7 +4023,7 @@ fn create_module_30() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -4177,7 +4177,7 @@ fn create_module_31() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -4357,7 +4357,7 @@ fn create_module_32() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -4529,7 +4529,7 @@ fn create_module_33() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -4704,7 +4704,7 @@ fn create_module_34() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -4885,7 +4885,7 @@ fn create_module_35() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -4943,7 +4943,7 @@ fn create_module_36() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -5060,7 +5060,7 @@ fn create_module_37() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -5305,7 +5305,7 @@ fn create_module_38() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -5507,7 +5507,7 @@ fn create_module_39() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -5691,7 +5691,7 @@ fn create_module_40() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -6084,7 +6084,7 @@ fn create_module_41() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -6258,7 +6258,7 @@ fn create_module_42() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -6449,7 +6449,7 @@ fn create_module_43() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -6863,7 +6863,7 @@ fn create_module_44() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -7449,7 +7449,7 @@ fn create_module_45() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -8027,7 +8027,7 @@ fn create_module_46() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -8621,7 +8621,7 @@ fn create_module_47() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9145,7 +9145,7 @@ fn create_module_48() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9230,7 +9230,7 @@ fn create_module_49() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9303,7 +9303,7 @@ fn create_module_50() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9344,7 +9344,7 @@ fn create_module_51() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9386,7 +9386,7 @@ fn create_module_52() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9431,7 +9431,7 @@ fn create_module_53() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9493,7 +9493,7 @@ fn create_module_54() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9574,7 +9574,7 @@ fn create_module_55() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9621,7 +9621,7 @@ fn create_module_56() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9679,7 +9679,7 @@ fn create_module_57() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -9926,7 +9926,7 @@ fn create_module_58() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -10106,7 +10106,7 @@ fn create_module_59() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -10332,7 +10332,7 @@ fn create_module_60() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -10478,7 +10478,7 @@ fn create_module_61() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -10612,7 +10612,7 @@ fn create_module_62() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -10724,7 +10724,7 @@ fn create_module_63() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -10786,7 +10786,7 @@ fn create_module_64() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -10920,7 +10920,7 @@ fn create_module_65() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -11056,7 +11056,7 @@ fn create_module_66() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -11190,7 +11190,7 @@ fn create_module_67() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -11350,7 +11350,7 @@ fn create_module_68() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -11520,7 +11520,7 @@ fn create_module_69() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -11707,7 +11707,7 @@ fn create_module_70() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -11886,7 +11886,7 @@ fn create_module_71() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -12069,7 +12069,7 @@ fn create_module_72() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -12223,7 +12223,7 @@ fn create_module_73() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -12401,7 +12401,7 @@ fn create_module_74() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -12578,7 +12578,7 @@ fn create_module_75() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -12738,7 +12738,7 @@ fn create_module_76() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -12843,7 +12843,7 @@ fn create_module_77() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -13047,7 +13047,7 @@ fn create_module_78() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -13123,7 +13123,7 @@ fn create_module_79() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -13259,7 +13259,7 @@ fn create_module_80() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -13537,7 +13537,7 @@ fn create_module_81() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -13605,7 +13605,7 @@ fn create_module_82() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -13694,7 +13694,7 @@ fn create_module_83() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -13832,7 +13832,7 @@ fn create_module_84() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -13988,7 +13988,7 @@ fn create_module_85() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -14071,7 +14071,7 @@ fn create_module_86() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -14190,7 +14190,7 @@ fn create_module_87() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -14495,7 +14495,7 @@ fn create_module_88() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -14944,7 +14944,7 @@ fn create_module_89() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -15032,7 +15032,7 @@ fn create_module_90() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -15144,7 +15144,7 @@ fn create_module_91() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -15218,7 +15218,7 @@ fn create_module_92() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -15300,7 +15300,7 @@ fn create_module_93() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -15440,7 +15440,7 @@ fn create_module_94() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -15536,7 +15536,7 @@ fn create_module_95() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -15600,7 +15600,7 @@ fn create_module_96() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/float_literals.rs b/lib/runtime/tests/spectests/float_literals.rs index 5cfb2ef1b..16a5f6184 100644 --- a/lib/runtime/tests/spectests/float_literals.rs +++ b/lib/runtime/tests/spectests/float_literals.rs @@ -334,7 +334,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1106,7 +1106,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/float_memory.rs b/lib/runtime/tests/spectests/float_memory.rs index 8d025626a..cf7b06056 100644 --- a/lib/runtime/tests/spectests/float_memory.rs +++ b/lib/runtime/tests/spectests/float_memory.rs @@ -50,7 +50,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -255,7 +255,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -460,7 +460,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -665,7 +665,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -870,7 +870,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1075,7 +1075,7 @@ fn create_module_6() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/float_misc.rs b/lib/runtime/tests/spectests/float_misc.rs index 5b022f75f..9c775373b 100644 --- a/lib/runtime/tests/spectests/float_misc.rs +++ b/lib/runtime/tests/spectests/float_misc.rs @@ -152,7 +152,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/forward.rs b/lib/runtime/tests/spectests/forward.rs index 628c90b70..e4c7c5ecf 100644 --- a/lib/runtime/tests/spectests/forward.rs +++ b/lib/runtime/tests/spectests/forward.rs @@ -49,7 +49,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/func.rs b/lib/runtime/tests/spectests/func.rs index a5fdd4d76..9db018f26 100644 --- a/lib/runtime/tests/spectests/func.rs +++ b/lib/runtime/tests/spectests/func.rs @@ -330,7 +330,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1037,7 +1037,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1150,7 +1150,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/func_ptrs.rs b/lib/runtime/tests/spectests/func_ptrs.rs index 4ef065158..6daa39a42 100644 --- a/lib/runtime/tests/spectests/func_ptrs.rs +++ b/lib/runtime/tests/spectests/func_ptrs.rs @@ -49,7 +49,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -200,7 +200,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -452,7 +452,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/get_local.rs b/lib/runtime/tests/spectests/get_local.rs index d259d78f2..688927bfc 100644 --- a/lib/runtime/tests/spectests/get_local.rs +++ b/lib/runtime/tests/spectests/get_local.rs @@ -123,7 +123,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/globals.rs b/lib/runtime/tests/spectests/globals.rs index c1012cdbf..16965874c 100644 --- a/lib/runtime/tests/spectests/globals.rs +++ b/lib/runtime/tests/spectests/globals.rs @@ -274,7 +274,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -838,7 +838,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -909,7 +909,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/i32_.rs b/lib/runtime/tests/spectests/i32_.rs index e7cdcf9d6..cb8df6ec0 100644 --- a/lib/runtime/tests/spectests/i32_.rs +++ b/lib/runtime/tests/spectests/i32_.rs @@ -165,7 +165,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/i64_.rs b/lib/runtime/tests/spectests/i64_.rs index 5826f02f5..eab462d4d 100644 --- a/lib/runtime/tests/spectests/i64_.rs +++ b/lib/runtime/tests/spectests/i64_.rs @@ -167,7 +167,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/if_.rs b/lib/runtime/tests/spectests/if_.rs index a7cb1e998..b0b2f9b05 100644 --- a/lib/runtime/tests/spectests/if_.rs +++ b/lib/runtime/tests/spectests/if_.rs @@ -640,7 +640,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/int_exprs.rs b/lib/runtime/tests/spectests/int_exprs.rs index 8e3a8faea..a56215203 100644 --- a/lib/runtime/tests/spectests/int_exprs.rs +++ b/lib/runtime/tests/spectests/int_exprs.rs @@ -60,7 +60,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -138,7 +138,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -192,7 +192,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -258,7 +258,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -354,7 +354,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -444,7 +444,7 @@ fn create_module_6() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -526,7 +526,7 @@ fn create_module_7() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -632,7 +632,7 @@ fn create_module_8() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -746,7 +746,7 @@ fn create_module_9() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -824,7 +824,7 @@ fn create_module_10() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -878,7 +878,7 @@ fn create_module_11() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -942,7 +942,7 @@ fn create_module_12() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1048,7 +1048,7 @@ fn create_module_13() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1166,7 +1166,7 @@ fn create_module_14() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1284,7 +1284,7 @@ fn create_module_15() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1402,7 +1402,7 @@ fn create_module_16() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1520,7 +1520,7 @@ fn create_module_17() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1638,7 +1638,7 @@ fn create_module_18() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -1746,7 +1746,7 @@ fn create_module_19() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/int_literals.rs b/lib/runtime/tests/spectests/int_literals.rs index 6e85b1953..5e63e1a7d 100644 --- a/lib/runtime/tests/spectests/int_literals.rs +++ b/lib/runtime/tests/spectests/int_literals.rs @@ -140,7 +140,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/labels.rs b/lib/runtime/tests/spectests/labels.rs index 92471dc81..9b851f53a 100644 --- a/lib/runtime/tests/spectests/labels.rs +++ b/lib/runtime/tests/spectests/labels.rs @@ -456,7 +456,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/left_to_right.rs b/lib/runtime/tests/spectests/left_to_right.rs index e29b544fc..b0a218770 100644 --- a/lib/runtime/tests/spectests/left_to_right.rs +++ b/lib/runtime/tests/spectests/left_to_right.rs @@ -964,7 +964,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/loop_.rs b/lib/runtime/tests/spectests/loop_.rs index a2c63c1ed..e3fac1584 100644 --- a/lib/runtime/tests/spectests/loop_.rs +++ b/lib/runtime/tests/spectests/loop_.rs @@ -672,7 +672,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/memory.rs b/lib/runtime/tests/spectests/memory.rs index d211d524d..784d13559 100644 --- a/lib/runtime/tests/spectests/memory.rs +++ b/lib/runtime/tests/spectests/memory.rs @@ -23,7 +23,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -48,7 +48,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -73,7 +73,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -98,7 +98,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -147,7 +147,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -186,7 +186,7 @@ fn create_module_6() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -225,7 +225,7 @@ fn create_module_7() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/memory_grow.rs b/lib/runtime/tests/spectests/memory_grow.rs index 9d57a7d62..af50733c5 100644 --- a/lib/runtime/tests/spectests/memory_grow.rs +++ b/lib/runtime/tests/spectests/memory_grow.rs @@ -51,7 +51,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -297,7 +297,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -399,7 +399,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -531,7 +531,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -938,7 +938,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/memory_redundancy.rs b/lib/runtime/tests/spectests/memory_redundancy.rs index 8819ebed2..5d4a2a057 100644 --- a/lib/runtime/tests/spectests/memory_redundancy.rs +++ b/lib/runtime/tests/spectests/memory_redundancy.rs @@ -99,7 +99,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/memory_trap.rs b/lib/runtime/tests/spectests/memory_trap.rs index 6359b28fe..523360e17 100644 --- a/lib/runtime/tests/spectests/memory_trap.rs +++ b/lib/runtime/tests/spectests/memory_trap.rs @@ -47,7 +47,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -363,7 +363,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/nop.rs b/lib/runtime/tests/spectests/nop.rs index f54d8a4a6..7da017361 100644 --- a/lib/runtime/tests/spectests/nop.rs +++ b/lib/runtime/tests/spectests/nop.rs @@ -637,7 +637,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/return_.rs b/lib/runtime/tests/spectests/return_.rs index e941477cc..0502f3439 100644 --- a/lib/runtime/tests/spectests/return_.rs +++ b/lib/runtime/tests/spectests/return_.rs @@ -417,7 +417,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/select.rs b/lib/runtime/tests/spectests/select.rs index f92737895..ee77826d8 100644 --- a/lib/runtime/tests/spectests/select.rs +++ b/lib/runtime/tests/spectests/select.rs @@ -80,7 +80,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/set_local.rs b/lib/runtime/tests/spectests/set_local.rs index 509b42f95..dba62ebd5 100644 --- a/lib/runtime/tests/spectests/set_local.rs +++ b/lib/runtime/tests/spectests/set_local.rs @@ -126,7 +126,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/stack.rs b/lib/runtime/tests/spectests/stack.rs index 60da7e0e4..e84893e78 100644 --- a/lib/runtime/tests/spectests/stack.rs +++ b/lib/runtime/tests/spectests/stack.rs @@ -163,7 +163,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -437,7 +437,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/start.rs b/lib/runtime/tests/spectests/start.rs index bb68ba090..4022b67bb 100644 --- a/lib/runtime/tests/spectests/start.rs +++ b/lib/runtime/tests/spectests/start.rs @@ -76,7 +76,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -167,7 +167,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -243,7 +243,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -274,7 +274,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -301,7 +301,7 @@ fn create_module_5() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/switch.rs b/lib/runtime/tests/spectests/switch.rs index 4b2da9a85..78c2c33ae 100644 --- a/lib/runtime/tests/spectests/switch.rs +++ b/lib/runtime/tests/spectests/switch.rs @@ -142,7 +142,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/tee_local.rs b/lib/runtime/tests/spectests/tee_local.rs index 3d94d0b99..72ba86b90 100644 --- a/lib/runtime/tests/spectests/tee_local.rs +++ b/lib/runtime/tests/spectests/tee_local.rs @@ -190,7 +190,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/traps.rs b/lib/runtime/tests/spectests/traps.rs index fa95f6d5c..78944997a 100644 --- a/lib/runtime/tests/spectests/traps.rs +++ b/lib/runtime/tests/spectests/traps.rs @@ -48,7 +48,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -209,7 +209,7 @@ fn create_module_2() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -347,7 +347,7 @@ fn create_module_3() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } @@ -587,7 +587,7 @@ fn create_module_4() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/types.rs b/lib/runtime/tests/spectests/types.rs index ebec42098..01302953f 100644 --- a/lib/runtime/tests/spectests/types.rs +++ b/lib/runtime/tests/spectests/types.rs @@ -36,7 +36,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") } diff --git a/lib/runtime/tests/spectests/unwind.rs b/lib/runtime/tests/spectests/unwind.rs index 18058bc9e..5b3ec0787 100644 --- a/lib/runtime/tests/spectests/unwind.rs +++ b/lib/runtime/tests/spectests/unwind.rs @@ -445,7 +445,7 @@ fn create_module_1() -> Instance { let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()) .expect("WASM can't be compiled"); module - .instantiate(generate_imports()) + .instantiate(&generate_imports()) .expect("WASM can't be instantiated") }