From 196795017bae358a0ae53fb9db3408a8c430657d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 3 Oct 2017 11:46:51 -0700 Subject: [PATCH] Tidy up handling of the DummyRuntime. --- cranelift/src/wasm.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index 840f108480..1c853efafa 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -4,7 +4,7 @@ //! IL. Can also executes the `start` function of the module by laying out the memories, globals //! and tables, then emitting the translated code with hardcoded addresses to memory. -use cton_wasm::{translate_module, DummyRuntime, WasmRuntime}; +use cton_wasm::{translate_module, DummyRuntime}; use std::path::PathBuf; use cretonne::Context; use cretonne::settings::FlagsOrIsa; @@ -99,10 +99,7 @@ fn handle_module( )?; } let mut dummy_runtime = DummyRuntime::with_flags(fisa.flags.clone()); - let translation = { - let runtime: &mut WasmRuntime = &mut dummy_runtime; - translate_module(&data, runtime)? - }; + let translation = translate_module(&data, &mut dummy_runtime)?; terminal.fg(term::color::GREEN).unwrap(); vprintln!(flag_verbose, "ok"); terminal.reset().unwrap();