Fix a number of warnings cropping up on nightly Rust (#2767)

Various small issues here and there, nothing major
This commit is contained in:
Alex Crichton
2021-03-25 13:19:37 -05:00
committed by GitHub
parent 3f694ae319
commit 30d9164b6e
9 changed files with 21 additions and 21 deletions

View File

@@ -13,8 +13,9 @@
//! here may not be super well documented. This file is 100% lifted from
//! SpiderMonkey and then adapted for Wasmtime's purposes. Credit for almost
//! all of this file goes to SpiderMonkey for figuring out all the fiddly bits.
//! See also https://searchfox.org/mozilla-central/source/js/src/wasm/WasmSignalHandlers.cpp for
//! the original code.
//! See also
//! <https://searchfox.org/mozilla-central/source/js/src/wasm/WasmSignalHandlers.cpp>
//! for the original code.
//!
//! The high-level overview is that when using mach ports a thread is blocked
//! when it generates an exception and then a message can be read from the
@@ -45,7 +46,8 @@ use std::cell::Cell;
use std::mem;
use std::thread;
/// Other `mach` declarations awaiting https://github.com/fitzgen/mach/pull/64 to be merged.
/// Other `mach` declarations awaiting <https://github.com/fitzgen/mach/pull/64>
/// to be merged.
mod mach_addons {
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]

View File

@@ -2,7 +2,6 @@ use crate::{sig_registry::SignatureRegistry, trampoline::StoreInstanceHandle};
use crate::{Config, Extern, FuncType, Store, Trap, Val, ValType};
use anyhow::{bail, Context as _, Result};
use smallvec::{smallvec, SmallVec};
use std::any::Any;
use std::cmp::max;
use std::fmt;
use std::future::Future;
@@ -43,7 +42,7 @@ impl HostFunc {
let func = Box::new(move |caller_vmctx, values_vec: *mut u128| {
// Lookup the last registered store as host functions have no associated store
let store = wasmtime_runtime::with_last_info(|last| {
last.and_then(Any::downcast_ref::<Store>)
last.and_then(|s| s.downcast_ref::<Store>())
.cloned()
.expect("Host function called without thread state")
});
@@ -401,7 +400,7 @@ impl Func {
let func = Box::new(move |caller_vmctx, values_vec: *mut u128| {
// Lookup the last registered store as host functions have no associated store
let store = wasmtime_runtime::with_last_info(|last| {
last.and_then(Any::downcast_ref::<Store>)
last.and_then(|s| s.downcast_ref::<Store>())
.cloned()
.expect("function called without thread state")
});
@@ -1586,7 +1585,7 @@ macro_rules! impl_into_func {
let func = &*(state as *const _ as *const F);
let store = wasmtime_runtime::with_last_info(|last| {
last.and_then(Any::downcast_ref::<Store>)
last.and_then(|s| s.downcast_ref::<Store>())
.cloned()
.expect("function called without thread state")
});