From 5ba55f067047c7a98264a26121792046882d299d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lo=C3=AFs?= Date: Wed, 14 Feb 2024 11:12:03 +0100 Subject: [PATCH] Update rust to v1.74 (#2647) * upgrade rust to v1.74 * run fmt * fix rustc warnings --- client/rpc/debug/src/lib.rs | 4 ++-- node/service/src/lib.rs | 4 ++-- precompiles/proxy/src/lib.rs | 3 ++- precompiles/utils/macro/src/derive_codec.rs | 8 ++++++-- runtime/moonriver/src/lib.rs | 1 - rust-toolchain | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/client/rpc/debug/src/lib.rs b/client/rpc/debug/src/lib.rs index f83a312b05..6b05126110 100644 --- a/client/rpc/debug/src/lib.rs +++ b/client/rpc/debug/src/lib.rs @@ -319,7 +319,7 @@ where let blockchain = backend.blockchain(); // Get the header I want to work with. let Ok(hash) = client.expect_block_hash_from_id(&reference_id) else { - return Err(internal_err("Block header not found")) + return Err(internal_err("Block header not found")); }; let header = match client.header(hash) { Ok(Some(h)) => h, @@ -453,7 +453,7 @@ where let blockchain = backend.blockchain(); // Get the header I want to work with. let Ok(reference_hash) = client.expect_block_hash_from_id(&reference_id) else { - return Err(internal_err("Block header not found")) + return Err(internal_err("Block header not found")); }; let header = match client.header(reference_hash) { Ok(Some(h)) => h, diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 68ca7f6aa1..e4f89a8b4f 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -911,8 +911,8 @@ where let BlockImportPipeline::Parachain(block_import) = block_import else { return Err(sc_service::Error::Other( - "Block import pipeline is not for parachain".into(), - )) + "Block import pipeline is not for parachain".into(), + )); }; if collator { diff --git a/precompiles/proxy/src/lib.rs b/precompiles/proxy/src/lib.rs index 017e2b851f..d92de06a50 100644 --- a/precompiles/proxy/src/lib.rs +++ b/precompiles/proxy/src/lib.rs @@ -353,7 +353,8 @@ where evm_subcall: EvmSubCall, ) -> EvmResult { // Check that we only perform proxy calls on behalf of externally owned accounts - let AddressType::EOA = precompile_set::get_address_type::(handle, real.into())? else { + let AddressType::EOA = precompile_set::get_address_type::(handle, real.into())? + else { return Err(revert("real address must be EOA")); }; diff --git a/precompiles/utils/macro/src/derive_codec.rs b/precompiles/utils/macro/src/derive_codec.rs index e988e380dc..55f99661fb 100644 --- a/precompiles/utils/macro/src/derive_codec.rs +++ b/precompiles/utils/macro/src/derive_codec.rs @@ -30,11 +30,15 @@ pub fn main(input: TokenStream) -> TokenStream { .. } = parse_macro_input!(input as DeriveInput); - let syn::Data::Struct (syn::DataStruct {fields: syn::Fields::Named(fields), ..}) = data else { + let syn::Data::Struct(syn::DataStruct { + fields: syn::Fields::Named(fields), + .. + }) = data + else { return quote_spanned! { ident.span() => compile_error!("Codec can only be derived for structs with named fields"); } - .into() + .into(); }; let fields = fields.named; diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 5a9d6fecee..27e83c8fdc 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -119,7 +119,6 @@ pub type Precompiles = MoonriverPrecompiles; pub mod asset_config; pub mod governance; pub mod xcm_config; -use governance::councils::*; pub use governance::councils::*; diff --git a/rust-toolchain b/rust-toolchain index a7267737d8..59adf7cc87 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,5 +1,5 @@ [toolchain] -channel = "1.71.0" +channel = "1.74.0" components = [ "rustfmt", "clippy" ] targets = [ "wasm32-unknown-unknown" ] profile = "minimal"