Fix bare_trait_objects warnings

This commit is contained in:
Brandon Fish
2019-08-08 16:46:52 -06:00
parent 3e23ace954
commit 5a41686192
9 changed files with 13 additions and 13 deletions

View File

@ -33,7 +33,7 @@ use wasmer_runtime_core::{
use wasmparser::Type as WpType;
pub struct CraneliftModuleCodeGenerator {
isa: Box<isa::TargetIsa>,
isa: Box<dyn isa::TargetIsa>,
signatures: Option<Arc<Map<SigIndex, FuncSig>>>,
pub clif_signatures: Map<SigIndex, ir::Signature>,
function_signatures: Option<Arc<Map<FuncIndex, SigIndex>>>,

View File

@ -26,7 +26,7 @@ extern crate serde_derive;
extern crate rayon;
extern crate serde;
fn get_isa() -> Box<isa::TargetIsa> {
fn get_isa() -> Box<dyn isa::TargetIsa> {
let flags = {
let mut builder = settings::builder();
builder.set("opt_level", "best").unwrap();

View File

@ -88,7 +88,7 @@ impl FuncResolverBuilder {
}
pub fn new(
isa: &isa::TargetIsa,
isa: &dyn isa::TargetIsa,
function_bodies: Map<LocalFuncIndex, ir::Function>,
info: &ModuleInfo,
) -> CompileResult<(Self, HandlerData)> {

View File

@ -66,7 +66,7 @@ impl Trampolines {
}
}
pub fn new(isa: &isa::TargetIsa, module: &ModuleInfo) -> Self {
pub fn new(isa: &dyn isa::TargetIsa, module: &ModuleInfo) -> Self {
let func_index_iter = module
.exports
.values()

View File

@ -18,7 +18,7 @@ use wasmparser::{self, WasmDecoder};
use wasmparser::{Operator, Type as WpType};
pub type BreakpointHandler =
Box<Fn(BreakpointInfo) -> Result<(), Box<dyn Any>> + Send + Sync + 'static>;
Box<dyn Fn(BreakpointInfo) -> Result<(), Box<dyn Any>> + Send + Sync + 'static>;
pub type BreakpointMap = Arc<HashMap<usize, BreakpointHandler>>;
#[derive(Debug)]
@ -232,7 +232,7 @@ impl<'a, 'b> EventSink<'a, 'b> {
}
pub struct MiddlewareChain {
chain: Vec<Box<GenericFunctionMiddleware>>,
chain: Vec<Box<dyn GenericFunctionMiddleware>>,
}
impl MiddlewareChain {

View File

@ -35,7 +35,7 @@ type SetJmpBuffer = [i32; SETJMP_BUFFER_LEN];
struct UnwindInfo {
jmpbuf: SetJmpBuffer, // in
breakpoints: Option<BreakpointMap>,
payload: Option<Box<Any>>, // out
payload: Option<Box<dyn Any>>, // out
}
thread_local! {
@ -89,7 +89,7 @@ pub unsafe fn clear_wasm_interrupt() {
pub unsafe fn catch_unsafe_unwind<R, F: FnOnce() -> R>(
f: F,
breakpoints: Option<BreakpointMap>,
) -> Result<R, Box<Any>> {
) -> Result<R, Box<dyn Any>> {
let unwind = UNWIND.with(|x| x.get());
let old = (*unwind).take();
*unwind = Some(UnwindInfo {
@ -111,7 +111,7 @@ pub unsafe fn catch_unsafe_unwind<R, F: FnOnce() -> R>(
}
}
pub unsafe fn begin_unsafe_unwind(e: Box<Any>) -> ! {
pub unsafe fn begin_unsafe_unwind(e: Box<dyn Any>) -> ! {
let unwind = UNWIND.with(|x| x.get());
let inner = (*unwind)
.as_mut()

View File

@ -46,7 +46,7 @@ impl IsExport for Export {
/// ```
pub struct ImportObject {
map: Rc<RefCell<HashMap<String, Box<dyn LikeNamespace>>>>,
pub(crate) state_creator: Option<Rc<Fn() -> (*mut c_void, fn(*mut c_void))>>,
pub(crate) state_creator: Option<Rc<dyn Fn() -> (*mut c_void, fn(*mut c_void))>>,
pub allow_missing_functions: bool,
}

View File

@ -763,7 +763,7 @@ mod vm_ctx_tests {
x: u32,
y: bool,
str: String,
finalizer: Box<FnMut()>,
finalizer: Box<dyn FnMut()>,
}
impl Drop for TestData {

View File

@ -148,7 +148,7 @@ pub struct X64FunctionCode {
breakpoints: Option<
HashMap<
AssemblyOffset,
Box<Fn(BreakpointInfo) -> Result<(), Box<dyn Any>> + Send + Sync + 'static>,
Box<dyn Fn(BreakpointInfo) -> Result<(), Box<dyn Any>> + Send + Sync + 'static>,
>,
>,
returns: SmallVec<[WpType; 1]>,
@ -294,7 +294,7 @@ impl RunnableModule for X64ExecutionContext {
})
}
unsafe fn do_early_trap(&self, data: Box<Any>) -> ! {
unsafe fn do_early_trap(&self, data: Box<dyn Any>) -> ! {
protect_unix::TRAP_EARLY_DATA.with(|x| x.set(Some(data)));
protect_unix::trigger_trap();
}