Skip to content

Commit

Permalink
Merge #430
Browse files Browse the repository at this point in the history
430: Add some initial deny for unused_imports and unused_variables r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
  • Loading branch information
bors[bot] and bjfish committed May 11, 2019
2 parents fa54025 + 5197d52 commit 3de17bb
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 7 deletions.
2 changes: 2 additions & 0 deletions lib/clif-backend/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(unused_imports, unused_variables)]

mod cache;
mod func_env;
mod libcalls;
Expand Down
2 changes: 2 additions & 0 deletions lib/emscripten/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(unused_imports, unused_variables)]

#[macro_use]
extern crate wasmer_runtime_core;

Expand Down
1 change: 0 additions & 1 deletion lib/emscripten/src/syscalls/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ use libc::{
sendto,
setpgid,
setsockopt,
size_t,
sockaddr,
socket,
socklen_t,
Expand Down
1 change: 1 addition & 0 deletions lib/llvm-backend/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(unused_imports, unused_variables)]
#![cfg_attr(nightly, feature(unwind_attributes))]

mod backend;
Expand Down
2 changes: 1 addition & 1 deletion lib/llvm-backend/src/platform/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub unsafe fn visit_fde(addr: *mut u8, size: usize, visitor: extern "C" fn(*mut
}

#[cfg(not(target_os = "macos"))]
pub unsafe fn visit_fde(addr: *mut u8, size: usize, visitor: extern "C" fn(*mut u8)) {
pub unsafe fn visit_fde(addr: *mut u8, _size: usize, visitor: extern "C" fn(*mut u8)) {
visitor(addr);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/middleware-common/src/call_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl FunctionMiddleware for CallTrace {
fn feed_event<'a, 'b: 'a>(
&mut self,
op: Event<'a, 'b>,
module_info: &ModuleInfo,
_module_info: &ModuleInfo,
sink: &mut EventSink<'a, 'b>,
) -> Result<(), Self::Error> {
match op {
Expand Down
2 changes: 2 additions & 0 deletions lib/middleware-common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#![deny(unused_imports, unused_variables)]

pub mod call_trace;
2 changes: 2 additions & 0 deletions lib/runtime-abi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(unused_imports, unused_variables)]

#[cfg(not(target_os = "windows"))]
#[macro_use]
extern crate failure;
Expand Down
2 changes: 2 additions & 0 deletions lib/runtime-c-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(unused_imports, unused_variables)]

extern crate wasmer_runtime;
extern crate wasmer_runtime_core;

Expand Down
2 changes: 1 addition & 1 deletion lib/runtime-core/src/codegen.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
backend::RunnableModule,
backend::{sys::Memory, Backend, CacheGen, Compiler, CompilerConfig, Token},
backend::{Backend, CacheGen, Compiler, CompilerConfig, Token},
cache::{Artifact, Error as CacheError},
error::{CompileError, CompileResult},
module::{ModuleInfo, ModuleInner},
Expand Down
1 change: 1 addition & 0 deletions lib/runtime-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(unused_imports, unused_variables)]
#![cfg_attr(nightly, feature(unwind_attributes))]

#[cfg(test)]
Expand Down
2 changes: 2 additions & 0 deletions lib/runtime/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(unused_imports, unused_variables)]

//! Wasmer-runtime is a library that makes embedding WebAssembly
//! in your application easy, efficient, and safe.
//!
Expand Down
4 changes: 2 additions & 2 deletions lib/singlepass-backend/src/codegen_x64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ impl ModuleCodeGenerator<X64FunctionCode, X64ExecutionContext, CodegenError>
Ok(())
}

unsafe fn from_cache(artifact: Artifact, _: Token) -> Result<ModuleInner, CacheError> {
unsafe fn from_cache(_artifact: Artifact, _: Token) -> Result<ModuleInner, CacheError> {
Err(CacheError::Unknown(
"the singlepass compiler API doesn't support caching yet".to_string(),
))
Expand Down Expand Up @@ -1409,7 +1409,7 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
Ok(())
}

fn begin_body(&mut self, module_info: &ModuleInfo) -> Result<(), CodegenError> {
fn begin_body(&mut self, _module_info: &ModuleInfo) -> Result<(), CodegenError> {
let a = self.assembler.as_mut().unwrap();
a.emit_push(Size::S64, Location::GPR(GPR::RBP));
a.emit_mov(Size::S64, Location::GPR(GPR::RSP), Location::GPR(GPR::RBP));
Expand Down
1 change: 1 addition & 0 deletions lib/singlepass-backend/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(unused_imports, unused_variables)]
#![feature(proc_macro_hygiene)]

#[cfg(not(any(
Expand Down
2 changes: 2 additions & 0 deletions lib/wasi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(unused_imports, unused_variables)]

#[macro_use]
extern crate log;

Expand Down
1 change: 0 additions & 1 deletion lib/win-exception-handler/src/exception_handling.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::ffi::c_void;
use std::ptr::NonNull;
use wasmer_runtime_core::vm::{Ctx, Func};

Expand Down
2 changes: 2 additions & 0 deletions lib/win-exception-handler/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(unused_imports, unused_variables)]

#[cfg(windows)]
mod exception_handling;

Expand Down
2 changes: 2 additions & 0 deletions src/bin/wasmer.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(unused_imports, unused_variables)]

extern crate structopt;

use std::env;
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(unused_imports, unused_variables)]

#[macro_use]
extern crate wasmer_runtime_core;
// extern crate wasmer_emscripten;
Expand Down

0 comments on commit 3de17bb

Please sign in to comment.