From e6801ddeb2feaecda2c29ef7c2623ae7e633ea89 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 12 Oct 2020 10:31:11 -0700 Subject: [PATCH] DO NOT MERGE TO MASTER. Remove parts of this test not relevant to the failure. --- lib/deprecated/runtime/examples/call.rs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/lib/deprecated/runtime/examples/call.rs b/lib/deprecated/runtime/examples/call.rs index b56914dd90a..9443f3015c4 100644 --- a/lib/deprecated/runtime/examples/call.rs +++ b/lib/deprecated/runtime/examples/call.rs @@ -5,14 +5,6 @@ static WAT: &'static str = r#" (module (type (;0;) (func (result i32))) (import "env" "do_panic" (func $do_panic (type 0))) - (func $dbz (result i32) - call $do_panic - drop - i32.const 42 - i32.const 0 - i32.div_u - ) - (export "dbz" (func $dbz)) ) "#; @@ -43,16 +35,13 @@ fn main() -> Result<(), Box> { println!("instantiating"); - let instance = module.instantiate(&imports! { + let imports = imports! { "env" => { "do_panic" => Func::new(do_panic), }, - })?; + }; - let foo: Func<(), i32> = instance.exports.get("dbz")?; - let result = foo.call(); - - println!("result: {:?}", result.unwrap_err().message()); + let instance = module.instantiate(&imports)?; Ok(()) }