mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-12 22:05:33 +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:
commit
17b5082c9b
@ -89,7 +89,6 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
|
||||
func,
|
||||
func_translator,
|
||||
next_local: 0,
|
||||
module_info: Arc::clone(&module_info),
|
||||
position: Position::default(),
|
||||
func_env: FunctionEnvironment {
|
||||
module_info: Arc::clone(&module_info),
|
||||
@ -394,7 +393,6 @@ pub struct CraneliftFunctionCodeGenerator {
|
||||
func: Function,
|
||||
func_translator: FuncTranslator,
|
||||
next_local: usize,
|
||||
module_info: Arc<RwLock<ModuleInfo>>,
|
||||
position: Position,
|
||||
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 code;
|
||||
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()
|
||||
}
|
||||
|
||||
#[warn(dead_code)]
|
||||
pub fn call_malloc_with_cast<T: Copy, Ty>(ctx: &mut Ctx, size: u32) -> WasmPtr<T, Ty> {
|
||||
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]
|
||||
extern crate wasmer_runtime_core;
|
||||
|
||||
@ -25,11 +30,11 @@ use wasmer_runtime_core::{
|
||||
};
|
||||
|
||||
#[cfg(unix)]
|
||||
use ::libc::DIR as libcDIR;
|
||||
use ::libc::DIR as LibcDir;
|
||||
|
||||
// We use a placeholder for windows
|
||||
#[cfg(not(unix))]
|
||||
type libcDIR = u8;
|
||||
type LibcDir = u8;
|
||||
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
@ -93,7 +98,7 @@ pub struct EmscriptenData<'a> {
|
||||
pub memset: Option<Func<'a, (u32, u32, u32), u32>>,
|
||||
pub stack_alloc: Option<Func<'a, u32, u32>>,
|
||||
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_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))]
|
||||
|
||||
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 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"))]
|
||||
#[macro_use]
|
||||
extern crate failure;
|
||||
|
@ -80,8 +80,13 @@
|
||||
//!
|
||||
//! [wasmer_h]: ./wasmer.h
|
||||
//! [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_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(test)]
|
||||
|
@ -100,6 +100,7 @@ pub struct InstanceImage {
|
||||
}
|
||||
|
||||
impl ModuleStateMap {
|
||||
#[warn(dead_code)]
|
||||
fn lookup_call_ip(&self, ip: usize, base: usize) -> Option<(&FunctionStateMap, MachineState)> {
|
||||
if ip < base || ip - base >= self.total_size {
|
||||
None
|
||||
@ -123,6 +124,7 @@ impl ModuleStateMap {
|
||||
}
|
||||
}
|
||||
|
||||
#[warn(dead_code)]
|
||||
fn lookup_trappable_ip(
|
||||
&self,
|
||||
ip: usize,
|
||||
@ -150,6 +152,7 @@ impl ModuleStateMap {
|
||||
}
|
||||
}
|
||||
|
||||
#[warn(dead_code)]
|
||||
fn lookup_loop_ip(&self, ip: usize, base: usize) -> Option<(&FunctionStateMap, MachineState)> {
|
||||
if ip < base || ip - base >= self.total_size {
|
||||
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
|
||||
//! 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)]
|
||||
|
||||
#[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")]
|
||||
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)]
|
||||
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 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;
|
||||
|
||||
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]
|
||||
extern crate wasmer_runtime_core;
|
||||
// extern crate wasmer_emscripten;
|
||||
|
Loading…
Reference in New Issue
Block a user