Fix tons of warnings in newest nightly (#2784)

* Fix tons of warnings in newest nightly

* Fix sr-api-macro doc tests
This commit is contained in:
Bastian Köcher
2019-06-04 20:09:49 +02:00
committed by GitHub
parent 9700029203
commit 6142f95611
73 changed files with 359 additions and 316 deletions
@@ -107,7 +107,7 @@ fn safe_call<F, U>(f: F) -> Result<U>
/// Set up the externalities and safe calling environment to execute calls to a native runtime.
///
/// If the inner closure panics, it will be caught and return an error.
pub fn with_native_environment<F, U>(ext: &mut Externalities<Blake2Hasher>, f: F) -> Result<U>
pub fn with_native_environment<F, U>(ext: &mut dyn Externalities<Blake2Hasher>, f: F) -> Result<U>
where F: UnwindSafe + FnOnce() -> U
{
::runtime_io::with_externalities(ext, move || safe_call(f))
@@ -121,7 +121,7 @@ pub trait NativeExecutionDispatch: Send + Sync {
/// Dispatch a method and input data to be executed natively. Returns `Some` result or `None`
/// if the `method` is unknown. Panics if there's an unrecoverable error.
// fn dispatch<H: hash_db::Hasher>(ext: &mut Externalities<H>, method: &str, data: &[u8]) -> Result<Vec<u8>>;
fn dispatch(ext: &mut Externalities<Blake2Hasher>, method: &str, data: &[u8]) -> Result<Vec<u8>>;
fn dispatch(ext: &mut dyn Externalities<Blake2Hasher>, method: &str, data: &[u8]) -> Result<Vec<u8>>;
/// Provide native runtime version.
fn native_version() -> NativeVersion;
+2 -2
View File
@@ -1101,7 +1101,7 @@ impl WasmExecutor {
/// This should be used for tests only.
pub fn call_with_custom_signature<
E: Externalities<Blake2Hasher>,
F: FnOnce(&mut FnMut(&[u8]) -> Result<u32>) -> Result<Vec<RuntimeValue>>,
F: FnOnce(&mut dyn FnMut(&[u8]) -> Result<u32>) -> Result<Vec<RuntimeValue>>,
FR: FnOnce(Option<RuntimeValue>, &MemoryRef) -> Result<Option<R>>,
R,
>(
@@ -1158,7 +1158,7 @@ impl WasmExecutor {
/// Call a given method in the given wasm-module runtime.
fn call_in_wasm_module_with_custom_signature<
E: Externalities<Blake2Hasher>,
F: FnOnce(&mut FnMut(&[u8]) -> Result<u32>) -> Result<Vec<RuntimeValue>>,
F: FnOnce(&mut dyn FnMut(&[u8]) -> Result<u32>) -> Result<Vec<RuntimeValue>>,
FR: FnOnce(Option<RuntimeValue>, &MemoryRef) -> Result<Option<R>>,
R,
>(
+1 -1
View File
@@ -174,7 +174,7 @@ macro_rules! impl_function_executor {
=> $($pre:tt)+ ) => (
impl $( $pre ) + $structname {
#[allow(unused)]
fn resolver() -> &'static $crate::wasmi::ModuleImportResolver {
fn resolver() -> &'static dyn $crate::wasmi::ModuleImportResolver {
struct Resolver;
impl $crate::wasmi::ModuleImportResolver for Resolver {
fn resolve_func(&self, name: &str, signature: &$crate::wasmi::Signature) -> ::std::result::Result<$crate::wasmi::FuncRef, $crate::wasmi::Error> {