From 9e93565a4945bd50c7552051aa57f13226c55a94 Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Sat, 20 Apr 2019 20:37:39 -0500 Subject: [PATCH] Cleanup build warnings imports and unnecessary unsafe --- lib/clif-backend/src/cache.rs | 2 +- lib/llvm-backend/src/backend.rs | 4 ++-- lib/singlepass-backend/src/lib.rs | 2 +- lib/singlepass-backend/src/parse.rs | 3 +-- lib/win-exception-handler/build.rs | 3 +-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/clif-backend/src/cache.rs b/lib/clif-backend/src/cache.rs index 8b6cb4684..b4f647372 100644 --- a/lib/clif-backend/src/cache.rs +++ b/lib/clif-backend/src/cache.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use wasmer_runtime_core::{ backend::{sys::Memory, CacheGen}, cache::{Artifact, Error}, - module::{ModuleInfo, ModuleInner}, + module::ModuleInfo, structures::Map, types::{LocalFuncIndex, SigIndex}, }; diff --git a/lib/llvm-backend/src/backend.rs b/lib/llvm-backend/src/backend.rs index 783a432ff..bbfed68a0 100644 --- a/lib/llvm-backend/src/backend.rs +++ b/lib/llvm-backend/src/backend.rs @@ -297,7 +297,7 @@ impl LLVMBackend { let callbacks = get_callbacks(); let mut module: *mut LLVMModule = ptr::null_mut(); - let slice = unsafe { memory.as_slice() }; + let slice = memory.as_slice(); let res = module_load(slice.as_ptr(), slice.len(), callbacks, &mut module); @@ -307,7 +307,7 @@ impl LLVMBackend { static SIGNAL_HANDLER_INSTALLED: Once = Once::new(); - SIGNAL_HANDLER_INSTALLED.call_once(|| unsafe { + SIGNAL_HANDLER_INSTALLED.call_once(|| { crate::platform::install_signal_handler(); }); diff --git a/lib/singlepass-backend/src/lib.rs b/lib/singlepass-backend/src/lib.rs index 7ecd029e4..967401cc9 100644 --- a/lib/singlepass-backend/src/lib.rs +++ b/lib/singlepass-backend/src/lib.rs @@ -31,7 +31,7 @@ use wasmer_runtime_core::{ backend::{sys::Memory, Backend, CacheGen, Compiler, CompilerConfig, Token}, cache::{Artifact, Error as CacheError}, error::{CompileError, CompileResult}, - module::{ModuleInfo, ModuleInner}, + module::ModuleInner, }; struct Placeholder; diff --git a/lib/singlepass-backend/src/parse.rs b/lib/singlepass-backend/src/parse.rs index e02b4b8c1..6e330490e 100644 --- a/lib/singlepass-backend/src/parse.rs +++ b/lib/singlepass-backend/src/parse.rs @@ -15,8 +15,7 @@ use wasmer_runtime_core::{ units::Pages, }; use wasmparser::{ - BinaryReaderError, Data, DataKind, Element, ElementKind, Export, ExternalKind, FuncType, - Import, ImportSectionEntryType, InitExpr, ModuleReader, Operator, SectionCode, Type as WpType, + BinaryReaderError, ExternalKind, FuncType, ImportSectionEntryType, Operator, Type as WpType, WasmDecoder, }; diff --git a/lib/win-exception-handler/build.rs b/lib/win-exception-handler/build.rs index 7376c6329..1ed351206 100644 --- a/lib/win-exception-handler/build.rs +++ b/lib/win-exception-handler/build.rs @@ -1,8 +1,7 @@ -use cmake::Config; - fn main() { #[cfg(target_os = "windows")] { + use cmake::Config; let project_name = "exception_handling"; let dst = Config::new(project_name).build(); println!("cargo:rustc-link-search=native={}", dst.display());