diff --git a/.github/workflows/fmt-check.yml b/.github/workflows/fmt-check.yml index 99ac512009..efcf278c46 100644 --- a/.github/workflows/fmt-check.yml +++ b/.github/workflows/fmt-check.yml @@ -15,7 +15,7 @@ jobs: os: ["ubuntu-latest"] runs-on: ${{ matrix.os }} container: - image: paritytech/ci-unified:bullseye-1.74.0-2023-11-01-v20231204 + image: docker.io/paritytech/ci-unified:bullseye-1.75.0-2024-01-22-v20240109 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c90a6c8e6e..a063cd901a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,8 @@ workflow: - if: $CI_COMMIT_BRANCH variables: - CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE] + # CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE] + CI_IMAGE: "docker.io/paritytech/ci-unified:bullseye-1.75.0-2024-01-22-v20240109" # BUILDAH_IMAGE is defined in group variables BUILDAH_COMMAND: "buildah --storage-driver overlay2" RELENG_SCRIPTS_BRANCH: "master" diff --git a/bridges/snowbridge/parachain/pallets/system/src/lib.rs b/bridges/snowbridge/parachain/pallets/system/src/lib.rs index 13abee14b4..b7f38fb753 100644 --- a/bridges/snowbridge/parachain/pallets/system/src/lib.rs +++ b/bridges/snowbridge/parachain/pallets/system/src/lib.rs @@ -79,8 +79,6 @@ use xcm_executor::traits::ConvertLocation; #[cfg(feature = "runtime-benchmarks")] use frame_support::traits::OriginTrait; -pub use pallet::*; - pub type BalanceOf = <::Token as Inspect<::AccountId>>::Balance; pub type AccountIdOf = ::AccountId; diff --git a/docs/sdk/src/reference_docs/development_environment_advice.rs b/docs/sdk/src/reference_docs/development_environment_advice.rs index 27dd463860..4317695979 100644 --- a/docs/sdk/src/reference_docs/development_environment_advice.rs +++ b/docs/sdk/src/reference_docs/development_environment_advice.rs @@ -38,7 +38,7 @@ //! // Use nightly formatting. //! // See the polkadot-sdk CI job that checks formatting for the current version used in //! // polkadot-sdk. -//! "rust-analyzer.rustfmt.extraArgs": ["+nightly-2023-11-01"], +//! "rust-analyzer.rustfmt.extraArgs": ["+nightly-2024-01-22"], //! } //! ``` //! @@ -79,7 +79,7 @@ //! # Use nightly formatting. //! # See the polkadot-sdk CI job that checks formatting for the current version used in //! # polkadot-sdk. -//! extraArgs = { "+nightly-2023-11-01" }, +//! extraArgs = { "+nightly-2024-01-22" }, //! }, //! }, //! ``` diff --git a/polkadot/node/subsystem-bench/src/availability/mod.rs b/polkadot/node/subsystem-bench/src/availability/mod.rs index 3a42190e6e..f9892efb3c 100644 --- a/polkadot/node/subsystem-bench/src/availability/mod.rs +++ b/polkadot/node/subsystem-bench/src/availability/mod.rs @@ -161,7 +161,7 @@ fn prepare_test_inner( candidate_hashes .get(&Hash::repeat_byte(block_num as u8)) .expect("just inserted above") - .get(0) + .first() .expect("just inserted above") .clone(), ); diff --git a/polkadot/node/subsystem-bench/src/core/keyring.rs b/polkadot/node/subsystem-bench/src/core/keyring.rs index 6cf031f571..66c7229847 100644 --- a/polkadot/node/subsystem-bench/src/core/keyring.rs +++ b/polkadot/node/subsystem-bench/src/core/keyring.rs @@ -17,7 +17,6 @@ use polkadot_primitives::ValidatorId; use sc_keystore::LocalKeystore; use sp_application_crypto::AppCrypto; -pub use sp_core::sr25519; use sp_core::sr25519::Public; use sp_keystore::Keystore; use std::sync::Arc; diff --git a/polkadot/node/subsystem-bench/src/core/mock/mod.rs b/polkadot/node/subsystem-bench/src/core/mock/mod.rs index 2bcc0c08c5..b67c6611e8 100644 --- a/polkadot/node/subsystem-bench/src/core/mock/mod.rs +++ b/polkadot/node/subsystem-bench/src/core/mock/mod.rs @@ -25,7 +25,6 @@ pub mod runtime_api; pub use av_store::*; pub use chain_api::*; -pub use network_bridge::*; pub use runtime_api::*; pub struct AlwaysSupportsParachains {} diff --git a/substrate/frame/alliance/src/mock.rs b/substrate/frame/alliance/src/mock.rs index 3d44374c3e..69c74d0b28 100644 --- a/substrate/frame/alliance/src/mock.rs +++ b/substrate/frame/alliance/src/mock.rs @@ -20,8 +20,8 @@ pub use sp_core::H256; use sp_runtime::traits::Hash; pub use sp_runtime::{ - traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Lazy, Verify}, - BuildStorage, MultiSignature, + traits::{BlakeTwo256, IdentifyAccount, Lazy, Verify}, + BuildStorage, }; use sp_std::convert::{TryFrom, TryInto}; diff --git a/substrate/frame/contracts/fixtures/build.rs b/substrate/frame/contracts/fixtures/build.rs index 5f174d200b..12a7805294 100644 --- a/substrate/frame/contracts/fixtures/build.rs +++ b/substrate/frame/contracts/fixtures/build.rs @@ -159,7 +159,7 @@ fn invoke_cargo_fmt<'a>( ) -> Result<()> { // If rustfmt is not installed, skip the check. if !Command::new("rustup") - .args(["nightly-2023-11-01", "run", "rustfmt", "--version"]) + .args(["nightly-2024-01-22", "run", "rustfmt", "--version"]) .output() .map_or(false, |o| o.status.success()) { @@ -167,7 +167,7 @@ fn invoke_cargo_fmt<'a>( } let fmt_res = Command::new("rustup") - .args(["nightly-2023-11-01", "run", "rustfmt", "--check", "--config-path"]) + .args(["nightly-2024-01-22", "run", "rustfmt", "--check", "--config-path"]) .arg(config_path) .args(files) .output() @@ -182,7 +182,7 @@ fn invoke_cargo_fmt<'a>( eprintln!("{}\n{}", stdout, stderr); eprintln!( "Fixtures files are not formatted.\n - Please run `rustup nightly-2023-11-01 run rustfmt --config-path {} {}/*.rs`", + Please run `rustup nightly-2024-01-22 run rustfmt --config-path {} {}/*.rs`", config_path.display(), contract_dir.display() ); @@ -309,7 +309,7 @@ fn find_workspace_root(current_dir: &Path) -> Option { let cargo_toml_contents = std::fs::read_to_string(current_dir.join("Cargo.toml")).ok()?; if cargo_toml_contents.contains("[workspace]") { - return Some(current_dir) + return Some(current_dir); } } diff --git a/substrate/frame/support/procedural/src/pallet/expand/call.rs b/substrate/frame/support/procedural/src/pallet/expand/call.rs index 624cde018d..90974619e8 100644 --- a/substrate/frame/support/procedural/src/pallet/expand/call.rs +++ b/substrate/frame/support/procedural/src/pallet/expand/call.rs @@ -261,6 +261,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream { }); quote::quote_spanned!(span => + #[doc(hidden)] mod warnings { #( #call_index_warnings @@ -270,6 +271,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream { )* } + #[allow(unused_imports)] #[doc(hidden)] pub mod __substrate_call_check { #[macro_export] @@ -455,6 +457,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream { } impl<#type_impl_gen> #pallet_ident<#type_use_gen> #where_clause { + #[allow(dead_code)] #[doc(hidden)] pub fn call_functions() -> #frame_support::__private::metadata_ir::PalletCallMetadataIR { #frame_support::__private::scale_info::meta_type::<#call_ident<#type_use_gen>>().into() diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr index b08efb3a84..61cfc07cae 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr @@ -449,3 +449,69 @@ note: required by a bound in `Result` | pub enum Result { | ^ required by this bound in `Result` = note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::codec::Decode` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `Runtime: Config` is not satisfied + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 + | +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, +... || +27 | || } +28 | || } + | ||_- in this macro invocation +... | + | + = note: required for `Pallet` to implement `Callable` +note: required because it appears within the type `RuntimeCall` + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 + | +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, +... || +27 | || } +28 | || } + | ||_- in this macro invocation +... | +note: required by a bound in `frame_support::sp_runtime::traits::Dispatchable::Config` + --> $WORKSPACE/substrate/primitives/runtime/src/traits.rs + | + | type Config; + | ^^^^^^^^^^^^ required by this bound in `Dispatchable::Config` + = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `Runtime: Config` is not satisfied + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 + | +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, +... || +27 | || } +28 | || } + | ||_- in this macro invocation +... | + | + = note: required for `Pallet` to implement `Callable` +note: required because it appears within the type `RuntimeCall` + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 + | +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, +... || +27 | || } +28 | || } + | ||_- in this macro invocation +... | +note: required by a bound in `frame_support::pallet_prelude::ValidateUnsigned::Call` + --> $WORKSPACE/substrate/primitives/runtime/src/traits.rs + | + | type Call; + | ^^^^^^^^^^ required by this bound in `ValidateUnsigned::Call` + = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.stderr b/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.stderr index a86fd96ea2..5a5b480973 100644 --- a/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.stderr @@ -2,4 +2,4 @@ error[E0220]: associated type `Block` not found for `Self` --> tests/pallet_ui/default_config_with_no_default_in_system.rs:25:31 | 25 | type MyGetParam2: Get; - | ^^^^^ there is a similarly named associated type `Block` in the trait `frame_system::Config` + | ^^^^^ there is an associated type `Block` in the trait `frame_system::Config` diff --git a/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.rs b/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.rs index 2e92f5358e..3c6730471c 100644 --- a/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.rs +++ b/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.rs @@ -16,6 +16,7 @@ // limitations under the License. #[frame_support::pallet] +#[allow(unused_imports)] mod pallet { #[pallet::config] pub trait Config: frame_system::Config {} @@ -32,5 +33,4 @@ mod pallet { #[derive(scale_info::TypeInfo, codec::Encode, codec::Decode)] enum MyError {} -fn main() { -} +fn main() {} diff --git a/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.stderr b/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.stderr index 9cefd2f489..44d8d3fcad 100644 --- a/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `MyError: PalletError` is not satisfied - --> tests/pallet_ui/error_does_not_derive_pallet_error.rs:28:15 + --> tests/pallet_ui/error_does_not_derive_pallet_error.rs:29:15 | -28 | CustomError(crate::MyError), +29 | CustomError(crate::MyError), | ^^^^^^^^^^^^^^ the trait `PalletError` is not implemented for `MyError` | = help: the following other types implement trait `PalletError`: diff --git a/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.rs b/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.rs index a7e6d21331..33603d6f55 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.rs +++ b/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.rs @@ -16,6 +16,7 @@ // limitations under the License. #[frame_support::pallet] +#[allow(unused_imports)] mod pallet { use frame_support::pallet_prelude::{Hooks, IsType}; use frame_system::pallet_prelude::BlockNumberFor; @@ -41,5 +42,4 @@ mod pallet { } } -fn main() { -} +fn main() {} diff --git a/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.stderr b/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.stderr index fc4a33b721..44660d2690 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.stderr @@ -1,19 +1,19 @@ error[E0277]: the trait bound `::Bar: Clone` is not satisfied - --> tests/pallet_ui/event_field_not_member.rs:40:7 + --> tests/pallet_ui/event_field_not_member.rs:41:7 | -40 | B { b: T::Bar }, +41 | B { b: T::Bar }, | ^ the trait `Clone` is not implemented for `::Bar` error[E0369]: binary operation `==` cannot be applied to type `&::Bar` - --> tests/pallet_ui/event_field_not_member.rs:40:7 + --> tests/pallet_ui/event_field_not_member.rs:41:7 | -40 | B { b: T::Bar }, +41 | B { b: T::Bar }, | ^ error[E0277]: `::Bar` doesn't implement `std::fmt::Debug` - --> tests/pallet_ui/event_field_not_member.rs:40:7 + --> tests/pallet_ui/event_field_not_member.rs:41:7 | -40 | B { b: T::Bar }, +41 | B { b: T::Bar }, | ^ `::Bar` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` | = help: the trait `std::fmt::Debug` is not implemented for `::Bar` diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/error_nested_types.rs b/substrate/frame/support/test/tests/pallet_ui/pass/error_nested_types.rs index 2e0df1ac39..0e0dc58905 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/error_nested_types.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/error_nested_types.rs @@ -19,6 +19,7 @@ use codec::{Decode, Encode}; use frame_support::PalletError; #[frame_support::pallet] +#[allow(unused_imports)] mod pallet { #[pallet::config] pub trait Config: frame_system::Config {} @@ -34,25 +35,24 @@ mod pallet { #[derive(Encode, Decode, PalletError, scale_info::TypeInfo)] pub enum MyError { - Foo, - Bar, - Baz(NestedError), - Struct(MyStruct), - Wrapper(Wrapper), + Foo, + Bar, + Baz(NestedError), + Struct(MyStruct), + Wrapper(Wrapper), } #[derive(Encode, Decode, PalletError, scale_info::TypeInfo)] pub enum NestedError { - Quux + Quux, } #[derive(Encode, Decode, PalletError, scale_info::TypeInfo)] pub struct MyStruct { - field: u8, + field: u8, } #[derive(Encode, Decode, PalletError, scale_info::TypeInfo)] pub struct Wrapper(bool); -fn main() { -} +fn main() {} diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/event_type_bound_system_config_assoc_type.rs b/substrate/frame/support/test/tests/pallet_ui/pass/event_type_bound_system_config_assoc_type.rs index 0a70c4a5e6..d84d320b0b 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/event_type_bound_system_config_assoc_type.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/event_type_bound_system_config_assoc_type.rs @@ -16,6 +16,7 @@ // limitations under the License. #[frame_support::pallet] +#[allow(unused_imports)] mod pallet { use frame_support::pallet_prelude::{Hooks, IsType}; use frame_system::pallet_prelude::BlockNumberFor; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.rs b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.rs index 4171596ddd..60f8b9a0ca 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.rs @@ -16,6 +16,7 @@ // limitations under the License. #[frame_support::pallet] +#[allow(unused_imports)] mod pallet { use frame_support::pallet_prelude::*; @@ -34,5 +35,4 @@ mod pallet { type Foo = StorageValue<_, u8, ResultQuery>; } -fn main() { -} +fn main() {} diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.stderr index 7ca7ec8bbb..af8ff50bf4 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.stderr @@ -1,15 +1,15 @@ error[E0107]: missing generics for enum `pallet::Error` - --> tests/pallet_ui/storage_result_query_missing_generics.rs:34:56 + --> tests/pallet_ui/storage_result_query_missing_generics.rs:35:56 | -34 | type Foo = StorageValue<_, u8, ResultQuery>; +35 | type Foo = StorageValue<_, u8, ResultQuery>; | ^^^^^ expected 1 generic argument | note: enum defined here, with 1 generic parameter: `T` - --> tests/pallet_ui/storage_result_query_missing_generics.rs:29:11 + --> tests/pallet_ui/storage_result_query_missing_generics.rs:30:11 | -29 | pub enum Error { +30 | pub enum Error { | ^^^^^ - help: add missing generic argument | -34 | type Foo = StorageValue<_, u8, ResultQuery::NonExistentValue>>; +35 | type Foo = StorageValue<_, u8, ResultQuery::NonExistentValue>>; | +++ diff --git a/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.rs b/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.rs index 4647a78809..e6533b4ccd 100644 --- a/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.rs +++ b/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.rs @@ -25,6 +25,7 @@ sp_api::decl_runtime_apis! { } } +#[allow(unused_imports)] mod second { sp_api::decl_runtime_apis! { pub trait Api { diff --git a/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.stderr b/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.stderr index 2197bbc99c..c401c7076e 100644 --- a/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.stderr +++ b/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.stderr @@ -1,11 +1,11 @@ error: Two traits with the same name detected! The trait name is used to generate its ID. Please rename one trait at the declaration! - --> tests/ui/impl_two_traits_with_same_name.rs:41:15 + --> tests/ui/impl_two_traits_with_same_name.rs:42:15 | -41 | impl second::Api for Runtime { +42 | impl second::Api for Runtime { | ^^^ error: First trait implementation. - --> tests/ui/impl_two_traits_with_same_name.rs:37:13 + --> tests/ui/impl_two_traits_with_same_name.rs:38:13 | -37 | impl self::Api for Runtime { +38 | impl self::Api for Runtime { | ^^^