Skip to content

Commit

Permalink
Merge #1035
Browse files Browse the repository at this point in the history
1035: Fix/quiet some rustc warnings. r=nlewycky a=nlewycky

No functionality change.

Remaining warnings are either dead code in examples/parallel-guest, or due to macros in typed_func.rs for which removing the "extra" parentheses breaks the build.

Co-authored-by: Nick Lewycky <[email protected]>
  • Loading branch information
bors[bot] and nlewycky authored Dec 3, 2019
2 parents 183beb7 + 3381e88 commit 7aa044e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/emscripten/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub struct EmscriptenData<'a> {
pub dyn_call_iii: Option<Func<'a, (i32, i32, i32), i32>>,
pub dyn_call_iiii: Option<Func<'a, (i32, i32, i32, i32), i32>>,
pub dyn_call_iifi: Option<Func<'a, (i32, i32, f64, i32), i32>>,
pub dyn_call_v: Option<Func<'a, (i32)>>,
pub dyn_call_v: Option<Func<'a, i32>>,
pub dyn_call_vi: Option<Func<'a, (i32, i32)>>,
pub dyn_call_vii: Option<Func<'a, (i32, i32, i32)>>,
pub dyn_call_viii: Option<Func<'a, (i32, i32, i32, i32)>>,
Expand Down Expand Up @@ -168,7 +168,7 @@ pub struct EmscriptenData<'a> {
pub temp_ret_0: i32,

pub stack_save: Option<Func<'a, (), i32>>,
pub stack_restore: Option<Func<'a, (i32)>>,
pub stack_restore: Option<Func<'a, i32>>,
pub set_threw: Option<Func<'a, (i32, i32)>>,
pub mapped_dirs: HashMap<String, PathBuf>,
}
Expand Down
4 changes: 2 additions & 2 deletions lib/middleware-common-tests/benches/metering_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ fn bench_metering(c: &mut Criterion) {
let wasm_binary = wat2wasm(WAT).unwrap();
let module = compile_with(&wasm_binary, &compiler).unwrap();
let import_object = imports! {};
let mut instance = module.instantiate(&import_object).unwrap();
let instance = module.instantiate(&import_object).unwrap();
let add_to: Func<(i32, i32), i32> = instance.func("add_to").unwrap();
b.iter(|| black_box(add_to.call(100, 4)))
})
Expand All @@ -202,7 +202,7 @@ fn bench_metering(c: &mut Criterion) {
"gas" => Func::new(gas),
},
};
let mut gas_instance = gas_module.instantiate(&gas_import_object).unwrap();
let gas_instance = gas_module.instantiate(&gas_import_object).unwrap();
let gas_add_to: Func<(i32, i32), i32> = gas_instance.func("add_to").unwrap();
b.iter(|| black_box(gas_add_to.call(100, 4)))
})
Expand Down
4 changes: 2 additions & 2 deletions lib/runtime/benches/many_instances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use criterion::Criterion;
use tempfile::tempdir;
use wasmer_runtime::{
cache::{Cache, FileSystemCache, WasmHash},
compile, func, imports, instantiate, validate, ImportObject,
compile, func, imports, instantiate, validate,
};
use wasmer_runtime_core::vm::Ctx;

Expand Down Expand Up @@ -71,7 +71,7 @@ fn calling_fn_benchmark(c: &mut Criterion) {
);
let instance = instantiate(SIMPLE_WASM, &imports).unwrap();
c.bench_function("calling fn", move |b| {
let entry_point = instance.func::<(i32), i32>("plugin_entrypoint").unwrap();
let entry_point = instance.func::<i32, i32>("plugin_entrypoint").unwrap();
b.iter(|| entry_point.call(2).unwrap())
});
}
Expand Down
4 changes: 2 additions & 2 deletions lib/singlepass-backend/src/emitter_x64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,9 @@ impl Emitter for Assembler {
fn emit_inline_breakpoint(&mut self, ty: InlineBreakpointType) {
dynasm!(self
; ud2
; .byte 0x0f ; .byte (0xb9u8 as i8) // ud
; .byte 0x0f ; .byte 0xb9u8 as i8 // ud
; int -1
; .byte (ty as u8 as i8)
; .byte ty as u8 as i8
);
}
}

0 comments on commit 7aa044e

Please sign in to comment.