Switch to Rust 2021 (#10170)

* Switch to Rust 2021

* Update trybuild to fix errors
This commit is contained in:
Bastian Köcher
2021-11-04 19:54:48 +01:00
committed by GitHub
parent 9fb9d7b8f0
commit b08d3017a8
245 changed files with 264 additions and 279 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-allocator"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-client-api"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "sc-authority-discovery"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
build = "build.rs"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-basic-authorship"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "beefy-gadget"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
+1 -1
View File
@@ -2,7 +2,7 @@
name = "beefy-gadget-rpc"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-block-builder"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-chain-spec"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "sc-chain-spec-derive"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -52,7 +52,7 @@ pub fn extension_derive(ast: &DeriveInput) -> proc_macro::TokenStream {
use std::any::{Any, TypeId};
match TypeId::of::<T>() {
#( x if x == TypeId::of::<#field_types>() => Any::downcast_ref(&self.#field_names) ),*,
#( x if x == TypeId::of::<#field_types>() => <dyn Any>::downcast_ref(&self.#field_names) ),*,
_ => None,
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-cli"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Substrate CLI interface."
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-consensus-aura"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Aura consensus algorithm for substrate"
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-consensus-babe"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "BABE consensus algorithm for substrate"
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -3,7 +3,7 @@ name = "sc-consensus-babe-rpc"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "RPC extensions for the BABE consensus algorithm"
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-consensus"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-consensus-epochs"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Generic epochs-based utilities for consensus"
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -3,7 +3,7 @@ name = "sc-consensus-manual-seal"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Manual sealing engine for Substrate"
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-consensus-pow"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "PoW consensus algorithm for substrate"
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-consensus-slots"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Generic slots-based utilities for consensus"
edition = "2018"
edition = "2021"
build = "build.rs"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-consensus-uncles"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Generic uncle inclusion utilities for consensus"
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-client-db"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-executor"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-executor-common"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "sc-runtime-test"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
build = "build.rs"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
publish = false
@@ -356,7 +356,6 @@ fn decode_version(mut version: &[u8]) -> Result<RuntimeVersion, WasmError> {
fn decode_runtime_apis(apis: &[u8]) -> Result<Vec<([u8; 8], u32)>, WasmError> {
use sp_api::RUNTIME_API_INFO_SIZE;
use std::convert::TryFrom;
apis.chunks(RUNTIME_API_INFO_SIZE)
.map(|chunk| {
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-executor-wasmi"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "sc-executor-wasmtime"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -4,7 +4,7 @@ name = "sc-finality-grandpa-warp-sync"
version = "0.10.0-dev"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-finality-grandpa"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -4,7 +4,7 @@ version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "RPC extensions for the GRANDPA finality gadget"
repository = "https://github.com/paritytech/substrate/"
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
readme = "README.md"
@@ -87,8 +87,6 @@ impl RoundState {
round_state: &report::RoundState<AuthorityId>,
voters: &HashSet<AuthorityId>,
) -> Result<Self, Error> {
use std::convert::TryInto;
let prevotes = &round_state.prevote_ids;
let missing_prevotes = voters.difference(&prevotes).cloned().collect();
@@ -130,8 +128,6 @@ impl ReportedRoundStates {
AuthoritySet: ReportAuthoritySet,
VoterState: ReportVoterState,
{
use std::convert::TryFrom;
let voter_state = voter_state.get().ok_or(Error::EndpointNotReady)?;
let (set_id, current_voters) = authority_set.get();
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-informant"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Substrate informant."
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-keystore"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -4,7 +4,7 @@ name = "sc-light"
version = "4.0.0-dev"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-light"
+1 -1
View File
@@ -4,7 +4,7 @@ name = "sc-network-gossip"
version = "0.10.0-dev"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-network-gossip"
+1 -1
View File
@@ -4,7 +4,7 @@ name = "sc-network"
version = "0.10.0-dev"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-network"
@@ -2172,7 +2172,6 @@ impl<B: BlockT> ChainSync<B> {
/// Return some key metrics.
pub(crate) fn metrics(&self) -> Metrics {
use std::convert::TryInto;
Metrics {
queued_blocks: self.queue_blocks.len().try_into().unwrap_or(std::u32::MAX),
fork_targets: self.fork_targets.len().try_into().unwrap_or(std::u32::MAX),
@@ -255,7 +255,6 @@ impl<B: BlockT> ExtraRequests<B> {
/// Get some key metrics.
pub(crate) fn metrics(&self) -> Metrics {
use std::convert::TryInto;
Metrics {
pending_requests: self.pending_requests.len().try_into().unwrap_or(std::u32::MAX),
active_requests: self.active_requests.len().try_into().unwrap_or(std::u32::MAX),
+1 -1
View File
@@ -4,7 +4,7 @@ name = "sc-network-test"
version = "0.8.0"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
publish = false
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -4,7 +4,7 @@ name = "sc-offchain"
version = "4.0.0-dev"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
readme = "README.md"
+1 -1
View File
@@ -5,7 +5,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
name = "sc-peerset"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-peerset"
readme = "README.md"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-proposer-metrics"
version = "0.9.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-rpc-api"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-rpc-server"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-rpc"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
-2
View File
@@ -83,8 +83,6 @@ where
match number {
None => Ok(Some(self.client().info().best_hash)),
Some(num_or_hex) => {
use std::convert::TryInto;
// FIXME <2329>: Database seems to limit the block number to u32 for no reason
let block_num: u32 = num_or_hex.try_into().map_err(|_| {
Error::Other(format!(
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-service"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-service-test"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
publish = false
homepage = "https://substrate.io"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-state-db"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-sync-state-rpc"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "A RPC handler to create sync states for light clients."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-telemetry"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Telemetry utils"
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "sc-tracing"
version = "4.0.0-dev"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "Instrumentation implementation for substrate."
@@ -2,7 +2,7 @@
name = "sc-tracing-proc-macro"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-transaction-pool"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "sc-transaction-pool-api"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sc-utils"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"