From dcc75b98ba600c3837cd54111ddc71760af70a96 Mon Sep 17 00:00:00 2001 From: Lachlan Sneff Date: Sat, 2 Feb 2019 16:02:28 -0800 Subject: [PATCH] Fix some tests --- lib/runtime-core/src/error.rs | 7 +++++++ lib/runtime-core/src/instance.rs | 2 +- lib/runtime-core/src/module.rs | 2 +- lib/runtime/src/lib.rs | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/runtime-core/src/error.rs b/lib/runtime-core/src/error.rs index 474cf63a6..69452b51a 100644 --- a/lib/runtime-core/src/error.rs +++ b/lib/runtime-core/src/error.rs @@ -187,6 +187,13 @@ impl From for Error { } } +impl From for Error { + fn from(resolve_err: ResolveError) -> Self { + Error::ResolveError(resolve_err) + } +} + + impl From for Error { fn from(call_err: CallError) -> Self { Error::CallError(call_err) diff --git a/lib/runtime-core/src/instance.rs b/lib/runtime-core/src/instance.rs index a8436ab46..743d1633a 100644 --- a/lib/runtime-core/src/instance.rs +++ b/lib/runtime-core/src/instance.rs @@ -438,7 +438,7 @@ impl<'a> DynFunc<'a> { /// # use wasmer_runtime_core::error::CallResult; /// # fn call_foo(instance: &mut Instance) -> CallResult<()> { /// instance - /// .func("foo")? + /// .dyn_func("foo")? /// .call(&[])?; /// # Ok(()) /// # } diff --git a/lib/runtime-core/src/module.rs b/lib/runtime-core/src/module.rs index 528a962a1..5b96fe639 100644 --- a/lib/runtime-core/src/module.rs +++ b/lib/runtime-core/src/module.rs @@ -74,7 +74,7 @@ impl Module { /// let import_object = imports! { /// // ... /// }; - /// let instance = module.instantiate(import_object)?; + /// let instance = module.instantiate(&import_object)?; /// // ... /// # Ok(()) /// # } diff --git a/lib/runtime/src/lib.rs b/lib/runtime/src/lib.rs index a4498bc1e..5356ea3f5 100644 --- a/lib/runtime/src/lib.rs +++ b/lib/runtime/src/lib.rs @@ -51,7 +51,7 @@ //! // We're not importing anything, so make an empty import object. //! let import_object = imports! {}; //! -//! let mut instance = instantiate(WASM, import_object)?; +//! let mut instance = instantiate(WASM, &import_object)?; //! //! let add_one: Func = instance.func("add_one")?; //!