diff --git a/substrate/core/cli/src/error.rs b/substrate/core/cli/src/error.rs index 1bb71274fe..b9a036ce1c 100644 --- a/substrate/core/cli/src/error.rs +++ b/substrate/core/cli/src/error.rs @@ -16,6 +16,10 @@ //! Initialization errors. +// Silence: `use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting` +// https://github.com/paritytech/substrate/issues/1547 +#![allow(deprecated)] + use client; use error_chain::{error_chain, error_chain_processing, impl_error_chain_processed, impl_extract_backtrace, impl_error_chain_kind}; diff --git a/substrate/core/client/src/error.rs b/substrate/core/client/src/error.rs index b4ed765084..fe823cd178 100644 --- a/substrate/core/client/src/error.rs +++ b/substrate/core/client/src/error.rs @@ -16,6 +16,9 @@ //! Substrate client possible errors. +// Silence: `use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting` +// https://github.com/paritytech/substrate/issues/1547 +#![allow(deprecated)] #![allow(missing_docs)] use std; diff --git a/substrate/core/executor/src/error.rs b/substrate/core/executor/src/error.rs index 330eef9028..2a5690d9f6 100644 --- a/substrate/core/executor/src/error.rs +++ b/substrate/core/executor/src/error.rs @@ -16,6 +16,10 @@ //! Rust executor possible errors. +// Silence: `use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting` +// https://github.com/paritytech/substrate/issues/1547 +#![allow(deprecated)] + use state_machine; use serializer; use wasmi; diff --git a/substrate/core/keystore/src/lib.rs b/substrate/core/keystore/src/lib.rs index baeeab2755..42b66eb14e 100644 --- a/substrate/core/keystore/src/lib.rs +++ b/substrate/core/keystore/src/lib.rs @@ -16,6 +16,10 @@ //! Keystore (and session key management) for ed25519 based chains like Polkadot. +// Silence: `use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting` +// https://github.com/paritytech/substrate/issues/1547 +#![allow(deprecated)] + extern crate substrate_primitives; extern crate parity_crypto as crypto; extern crate subtle; diff --git a/substrate/core/network/src/error.rs b/substrate/core/network/src/error.rs index dcfdee8fd4..71637672f2 100644 --- a/substrate/core/network/src/error.rs +++ b/substrate/core/network/src/error.rs @@ -16,6 +16,10 @@ //! Substrate service possible errors. +// Silence: `use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting` +// https://github.com/paritytech/substrate/issues/1547 +#![allow(deprecated)] + use std::io::Error as IoError; use network_libp2p::Error as NetworkError; use client; diff --git a/substrate/core/primitives/src/lib.rs b/substrate/core/primitives/src/lib.rs index c1f427f496..9b3d4e193b 100644 --- a/substrate/core/primitives/src/lib.rs +++ b/substrate/core/primitives/src/lib.rs @@ -47,7 +47,6 @@ extern crate untrusted; extern crate hex_literal; #[cfg(feature = "std")] -#[macro_use] extern crate impl_serde; #[cfg(feature = "std")] diff --git a/substrate/core/service/src/error.rs b/substrate/core/service/src/error.rs index f346db434a..d57c796e51 100644 --- a/substrate/core/service/src/error.rs +++ b/substrate/core/service/src/error.rs @@ -16,6 +16,10 @@ //! Errors that can occur during the service operation. +// Silence: `use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting` +// https://github.com/paritytech/substrate/issues/1547 +#![allow(deprecated)] + use client; use network; use keystore; diff --git a/substrate/core/sr-io/without_std.rs b/substrate/core/sr-io/without_std.rs index c1bee27800..229f971f28 100644 --- a/substrate/core/sr-io/without_std.rs +++ b/substrate/core/sr-io/without_std.rs @@ -58,17 +58,11 @@ pub extern fn oom(_: ::core::alloc::Layout) -> ! { /// (most importantly, storage) or perform heavy hash calculations. /// See also "ext_" functions in sr-sandbox and sr-std extern "C" { - /// Most of the functions below return fixed-size arrays (e.g. hashes) by writing them into - /// memory regions that should be preallocated by module. - /// Functions that return variable-sized data use host-side allocations. These should be - /// manually freed by the module. - fn ext_free(addr: *mut u8); - /// Printing, useful for debugging fn ext_print_utf8(utf8_data: *const u8, utf8_len: u32); fn ext_print_hex(data: *const u8, len: u32); fn ext_print_num(value: u64); - + /// Host storage access and verification fn ext_set_storage(key_data: *const u8, key_len: u32, value_data: *const u8, value_len: u32); fn ext_set_child_storage(storage_key_data: *const u8, storage_key_len: u32, key_data: *const u8, key_len: u32, value_data: *const u8, value_len: u32); @@ -86,12 +80,12 @@ extern "C" { fn ext_get_child_storage_into(storage_key_data: *const u8, storage_key_len: u32, key_data: *const u8, key_len: u32, value_data: *mut u8, value_len: u32, value_offset: u32) -> u32; fn ext_storage_root(result: *mut u8); /// Host-side result allocation - fn ext_child_storage_root(storage_key_data: *const u8, storage_key_len: u32, written_out: *mut u32) -> *mut u8; + fn ext_child_storage_root(storage_key_data: *const u8, storage_key_len: u32, written_out: *mut u32) -> *mut u8; fn ext_storage_changes_root(parent_hash_data: *const u8, parent_hash_len: u32, parent_num: u64, result: *mut u8) -> u32; - + /// The current relay chain identifier. fn ext_chain_id() -> u64; - + /// Hash calculation and verification fn ext_blake2_256_enumerated_trie_root(values_data: *const u8, lens_data: *const u32, lens_len: u32, result: *mut u8); fn ext_blake2_256(data: *const u8, len: u32, out: *mut u8); diff --git a/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm b/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm index 00c1df5af4..edede7bdd5 100644 Binary files a/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm and b/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm differ diff --git a/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm b/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm index 00530858ca..25c28b6eb8 100644 Binary files a/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm and b/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm differ diff --git a/substrate/srml/support/procedural/src/storage/transformation.rs b/substrate/srml/support/procedural/src/storage/transformation.rs index 41a24ccfef..9517e4389b 100644 --- a/substrate/srml/support/procedural/src/storage/transformation.rs +++ b/substrate/srml/support/procedural/src/storage/transformation.rs @@ -283,15 +283,14 @@ fn decl_store_extra_genesis( } - let serde_bug_bound = if serde_complete_bound.len() > 0 { - + let serde_bug_bound = if !serde_complete_bound.is_empty() { let mut b_ser = String::new(); let mut b_dser = String::new(); - for bound in serde_complete_bound { + serde_complete_bound.into_iter().for_each(|bound| { let stype = quote!(#bound); - b_ser += &(stype.to_string() + " : " + &scrate.to_string() + "::serde::Serialize, "); - b_dser += &(stype.to_string() + " : " + &scrate.to_string() + "::serde::de::DeserializeOwned, "); - } + b_ser.push_str(&format!("{} : {}::serde::Serialize, ", stype, scrate)); + b_dser.push_str(&format!("{} : {}::serde::de::DeserializeOwned, ", stype, scrate)); + }); quote! { #[serde(bound(serialize = #b_ser))] @@ -336,7 +335,7 @@ fn decl_store_extra_genesis( }; quote!{ - #[derive(Serialize, Deserialize)] + #[derive(#scrate::Serialize, #scrate::Deserialize)] #[cfg(feature = "std")] #[serde(rename_all = "camelCase")] #[serde(deny_unknown_fields)] @@ -730,4 +729,3 @@ fn get_type_infos(storage_type: &DeclStorageType) -> DeclStorageTypeInfos { map_key, } } - diff --git a/substrate/srml/support/src/event.rs b/substrate/srml/support/src/event.rs index 8711646d6e..1ab4d6bc67 100644 --- a/substrate/srml/support/src/event.rs +++ b/substrate/srml/support/src/event.rs @@ -268,7 +268,7 @@ macro_rules! __events_to_metadata { } } -/// Constructs an Event type for a runtime. This is usually called automatically by the +/// Constructs an Event type for a runtime. This is usually called automatically by the /// construct_runtime macro. See also __create_decl_macro. #[macro_export] macro_rules! impl_outer_event { @@ -441,6 +441,7 @@ macro_rules! __impl_outer_event_json_metadata { #[allow(dead_code)] mod tests { use super::*; + use serde_derive::Serialize; mod system { pub trait Trait { diff --git a/substrate/srml/support/src/lib.rs b/substrate/srml/support/src/lib.rs index 5ad2985839..0be31b3199 100644 --- a/substrate/srml/support/src/lib.rs +++ b/substrate/srml/support/src/lib.rs @@ -38,7 +38,6 @@ extern crate substrate_inherents as inherents; #[macro_use] extern crate pretty_assertions; #[cfg(feature = "std")] -#[macro_use] extern crate serde_derive; #[cfg(test)] #[macro_use]