diff --git a/lib/clif-backend/src/lib.rs b/lib/clif-backend/src/lib.rs index 639249c34..50fbe5dbf 100644 --- a/lib/clif-backend/src/lib.rs +++ b/lib/clif-backend/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] mod cache; mod func_env; diff --git a/lib/emscripten/src/lib.rs b/lib/emscripten/src/lib.rs index e996fe58b..6b0340513 100644 --- a/lib/emscripten/src/lib.rs +++ b/lib/emscripten/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] #[macro_use] extern crate wasmer_runtime_core; diff --git a/lib/llvm-backend/src/lib.rs b/lib/llvm-backend/src/lib.rs index c8bc50318..6d8816af8 100644 --- a/lib/llvm-backend/src/lib.rs +++ b/lib/llvm-backend/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] #![cfg_attr(nightly, feature(unwind_attributes))] mod backend; diff --git a/lib/middleware-common/src/lib.rs b/lib/middleware-common/src/lib.rs index 83b1ee35d..e09d9ee03 100644 --- a/lib/middleware-common/src/lib.rs +++ b/lib/middleware-common/src/lib.rs @@ -1,3 +1,3 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] pub mod call_trace; diff --git a/lib/runtime-abi/src/lib.rs b/lib/runtime-abi/src/lib.rs index f4b51b1f0..d1c9e2326 100644 --- a/lib/runtime-abi/src/lib.rs +++ b/lib/runtime-abi/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] #[cfg(not(target_os = "windows"))] #[macro_use] diff --git a/lib/runtime-c-api/src/lib.rs b/lib/runtime-c-api/src/lib.rs index 6a26d6027..f4d4cc2be 100644 --- a/lib/runtime-c-api/src/lib.rs +++ b/lib/runtime-c-api/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] extern crate wasmer_runtime; extern crate wasmer_runtime_core; diff --git a/lib/runtime-core/src/codegen.rs b/lib/runtime-core/src/codegen.rs index 296d1a740..b61ce58bb 100644 --- a/lib/runtime-core/src/codegen.rs +++ b/lib/runtime-core/src/codegen.rs @@ -35,7 +35,6 @@ impl fmt::Debug for InternalEvent { InternalEvent::Breakpoint(_) => write!(f, "Breakpoint"), InternalEvent::SetInternal(_) => write!(f, "SetInternal"), InternalEvent::GetInternal(_) => write!(f, "GetInternal"), - _ => panic!("unknown event"), } } } diff --git a/lib/runtime-core/src/lib.rs b/lib/runtime-core/src/lib.rs index 2a0cca431..da9144a2b 100644 --- a/lib/runtime-core/src/lib.rs +++ b/lib/runtime-core/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] #![cfg_attr(nightly, feature(unwind_attributes))] #[cfg(test)] diff --git a/lib/runtime/src/lib.rs b/lib/runtime/src/lib.rs index ba7f4440b..bfdf6c9f7 100644 --- a/lib/runtime/src/lib.rs +++ b/lib/runtime/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] //! Wasmer-runtime is a library that makes embedding WebAssembly //! in your application easy, efficient, and safe. diff --git a/lib/singlepass-backend/src/codegen_x64.rs b/lib/singlepass-backend/src/codegen_x64.rs index f7868bc53..9aa6c9151 100644 --- a/lib/singlepass-backend/src/codegen_x64.rs +++ b/lib/singlepass-backend/src/codegen_x64.rs @@ -212,10 +212,10 @@ impl RunnableModule for X64ExecutionContext { user_error: *mut Option>, num_params_plus_one: Option>, ) -> bool { - let rm: &Box = &unsafe { &*(*ctx).module }.runnable_module; - let execution_context = unsafe { - ::std::mem::transmute_copy::<&dyn RunnableModule, &X64ExecutionContext>(&&**rm) - }; + let rm: &Box = &(&*(*ctx).module).runnable_module; + let execution_context = + ::std::mem::transmute_copy::<&dyn RunnableModule, &X64ExecutionContext>(&&**rm); + let args = ::std::slice::from_raw_parts( args, num_params_plus_one.unwrap().as_ptr() as usize - 1, diff --git a/lib/singlepass-backend/src/lib.rs b/lib/singlepass-backend/src/lib.rs index eec02cbfd..f1011591d 100644 --- a/lib/singlepass-backend/src/lib.rs +++ b/lib/singlepass-backend/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] #![feature(proc_macro_hygiene)] #[cfg(not(any( diff --git a/lib/wasi/src/lib.rs b/lib/wasi/src/lib.rs index 241cc607c..86f9ceaac 100644 --- a/lib/wasi/src/lib.rs +++ b/lib/wasi/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] #[macro_use] extern crate log; diff --git a/lib/win-exception-handler/src/lib.rs b/lib/win-exception-handler/src/lib.rs index dfb95d0e1..5329e1cc0 100644 --- a/lib/win-exception-handler/src/lib.rs +++ b/lib/win-exception-handler/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] #[cfg(windows)] mod exception_handling; diff --git a/src/bin/wasmer.rs b/src/bin/wasmer.rs index cd36651a5..14386d1b1 100644 --- a/src/bin/wasmer.rs +++ b/src/bin/wasmer.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] extern crate structopt; diff --git a/src/lib.rs b/src/lib.rs index 9105e278e..78d6dae28 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(unused_imports, unused_variables)] +#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)] #[macro_use] extern crate wasmer_runtime_core;