mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-25 22:51:32 +00:00
Merge pull request #621 from wasmerio/feature/add-deny-dead_code-lint
Add deny dead_code lint and fix one error
This commit is contained in:
@ -89,7 +89,6 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
|
|||||||
func,
|
func,
|
||||||
func_translator,
|
func_translator,
|
||||||
next_local: 0,
|
next_local: 0,
|
||||||
module_info: Arc::clone(&module_info),
|
|
||||||
position: Position::default(),
|
position: Position::default(),
|
||||||
func_env: FunctionEnvironment {
|
func_env: FunctionEnvironment {
|
||||||
module_info: Arc::clone(&module_info),
|
module_info: Arc::clone(&module_info),
|
||||||
@ -394,7 +393,6 @@ pub struct CraneliftFunctionCodeGenerator {
|
|||||||
func: Function,
|
func: Function,
|
||||||
func_translator: FuncTranslator,
|
func_translator: FuncTranslator,
|
||||||
next_local: usize,
|
next_local: usize,
|
||||||
module_info: Arc<RwLock<ModuleInfo>>,
|
|
||||||
position: Position,
|
position: Position,
|
||||||
func_env: FunctionEnvironment,
|
func_env: FunctionEnvironment,
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
mod cache;
|
mod cache;
|
||||||
mod code;
|
mod code;
|
||||||
mod libcalls;
|
mod libcalls;
|
||||||
|
1
lib/emscripten/src/env/mod.rs
vendored
1
lib/emscripten/src/env/mod.rs
vendored
@ -30,6 +30,7 @@ pub fn call_malloc(ctx: &mut Ctx, size: u32) -> u32 {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[warn(dead_code)]
|
||||||
pub fn call_malloc_with_cast<T: Copy, Ty>(ctx: &mut Ctx, size: u32) -> WasmPtr<T, Ty> {
|
pub fn call_malloc_with_cast<T: Copy, Ty>(ctx: &mut Ctx, size: u32) -> WasmPtr<T, Ty> {
|
||||||
WasmPtr::new(call_malloc(ctx, size))
|
WasmPtr::new(call_malloc(ctx, size))
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate wasmer_runtime_core;
|
extern crate wasmer_runtime_core;
|
||||||
|
|
||||||
@ -25,11 +30,11 @@ use wasmer_runtime_core::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use ::libc::DIR as libcDIR;
|
use ::libc::DIR as LibcDir;
|
||||||
|
|
||||||
// We use a placeholder for windows
|
// We use a placeholder for windows
|
||||||
#[cfg(not(unix))]
|
#[cfg(not(unix))]
|
||||||
type libcDIR = u8;
|
type LibcDir = u8;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod macros;
|
mod macros;
|
||||||
@ -93,7 +98,7 @@ pub struct EmscriptenData<'a> {
|
|||||||
pub memset: Option<Func<'a, (u32, u32, u32), u32>>,
|
pub memset: Option<Func<'a, (u32, u32, u32), u32>>,
|
||||||
pub stack_alloc: Option<Func<'a, u32, u32>>,
|
pub stack_alloc: Option<Func<'a, u32, u32>>,
|
||||||
pub jumps: Vec<UnsafeCell<[u32; 27]>>,
|
pub jumps: Vec<UnsafeCell<[u32; 27]>>,
|
||||||
pub opened_dirs: HashMap<i32, Box<*mut libcDIR>>,
|
pub opened_dirs: HashMap<i32, Box<*mut LibcDir>>,
|
||||||
|
|
||||||
pub dyn_call_i: Option<Func<'a, i32, i32>>,
|
pub dyn_call_i: Option<Func<'a, i32, i32>>,
|
||||||
pub dyn_call_ii: Option<Func<'a, (i32, i32), i32>>,
|
pub dyn_call_ii: Option<Func<'a, (i32, i32), i32>>,
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
#![cfg_attr(nightly, feature(unwind_attributes))]
|
#![cfg_attr(nightly, feature(unwind_attributes))]
|
||||||
|
|
||||||
mod backend;
|
mod backend;
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
pub mod call_trace;
|
pub mod call_trace;
|
||||||
pub mod metering;
|
pub mod metering;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(dead_code, unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
||||||
|
|
||||||
#[cfg(not(target_os = "windows"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate failure;
|
extern crate failure;
|
||||||
|
@ -80,8 +80,13 @@
|
|||||||
//!
|
//!
|
||||||
//! [wasmer_h]: ./wasmer.h
|
//! [wasmer_h]: ./wasmer.h
|
||||||
//! [wasmer_hh]: ./wasmer.hh
|
//! [wasmer_hh]: ./wasmer.hh
|
||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
extern crate wasmer_runtime;
|
extern crate wasmer_runtime;
|
||||||
extern crate wasmer_runtime_core;
|
extern crate wasmer_runtime_core;
|
||||||
|
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
#![cfg_attr(nightly, feature(unwind_attributes))]
|
#![cfg_attr(nightly, feature(unwind_attributes))]
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
@ -100,6 +100,7 @@ pub struct InstanceImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ModuleStateMap {
|
impl ModuleStateMap {
|
||||||
|
#[warn(dead_code)]
|
||||||
fn lookup_call_ip(&self, ip: usize, base: usize) -> Option<(&FunctionStateMap, MachineState)> {
|
fn lookup_call_ip(&self, ip: usize, base: usize) -> Option<(&FunctionStateMap, MachineState)> {
|
||||||
if ip < base || ip - base >= self.total_size {
|
if ip < base || ip - base >= self.total_size {
|
||||||
None
|
None
|
||||||
@ -123,6 +124,7 @@ impl ModuleStateMap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[warn(dead_code)]
|
||||||
fn lookup_trappable_ip(
|
fn lookup_trappable_ip(
|
||||||
&self,
|
&self,
|
||||||
ip: usize,
|
ip: usize,
|
||||||
@ -150,6 +152,7 @@ impl ModuleStateMap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[warn(dead_code)]
|
||||||
fn lookup_loop_ip(&self, ip: usize, base: usize) -> Option<(&FunctionStateMap, MachineState)> {
|
fn lookup_loop_ip(&self, ip: usize, base: usize) -> Option<(&FunctionStateMap, MachineState)> {
|
||||||
if ip < base || ip - base >= self.total_size {
|
if ip < base || ip - base >= self.total_size {
|
||||||
None
|
None
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
//! Wasmer-runtime is a library that makes embedding WebAssembly
|
//! Wasmer-runtime is a library that makes embedding WebAssembly
|
||||||
//! in your application easy, efficient, and safe.
|
//! in your application easy, efficient, and safe.
|
||||||
//!
|
//!
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
#![feature(proc_macro_hygiene)]
|
#![feature(proc_macro_hygiene)]
|
||||||
|
|
||||||
#[cfg(not(any(
|
#[cfg(not(any(
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
#[cfg(target = "windows")]
|
#[cfg(target = "windows")]
|
||||||
extern crate winapi;
|
extern crate winapi;
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
mod exception_handling;
|
mod exception_handling;
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
extern crate byteorder;
|
extern crate byteorder;
|
||||||
extern crate structopt;
|
extern crate structopt;
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
extern crate structopt;
|
extern crate structopt;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
unused_imports,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate wasmer_runtime_core;
|
extern crate wasmer_runtime_core;
|
||||||
// extern crate wasmer_emscripten;
|
// extern crate wasmer_emscripten;
|
||||||
|
Reference in New Issue
Block a user