From e46f620bb88b4aac19a3cbe463b4eef78ef8335d Mon Sep 17 00:00:00 2001 From: Mira Ressel Date: Fri, 5 May 2023 16:00:41 +0200 Subject: [PATCH] Bump ci-linux to rust 1.69 (#14060) * Pin ci-linux image for rust 1.69 * Update ui tests for rust 1.69 * Address new rust 1.69 clippy lints * `derive_hash_xor_eq` has been renamed to `derived_hash_with_manual_eq` * The new `extra-unused-type-parameters` complains about a bunch of callsites where extraneous type parameters are used for consistency with other functions. --- .cargo/config.toml | 1 + .gitlab-ci.yml | 2 +- .../network/sync/src/block_request_handler.rs | 2 +- .../network/sync/src/state_request_handler.rs | 2 +- .../tests/benchmark_ui/invalid_origin.stderr | 2 +- .../undefined_inherent_part.stderr | 25 ++++++++------ .../undefined_validate_unsigned_part.stderr | 33 +++++++++++-------- .../call_weight_inherited_invalid4.stderr | 4 +-- .../type_value_forgotten_where_clause.stderr | 6 ++-- .../ui/impl_incorrect_method_signature.stderr | 4 +-- 10 files changed, 46 insertions(+), 35 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 66b28b3485d86..e29275804bd85 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -29,4 +29,5 @@ rustflags = [ "-Aclippy::needless_option_as_deref", # false positives "-Aclippy::derivable_impls", # false positives "-Aclippy::stable_sort_primitive", # prefer stable sort + "-Aclippy::extra-unused-type-parameters" # stylistic ] diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 59d42936e1769..bf96597bd8f53 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,7 +48,7 @@ variables: CARGO_INCREMENTAL: 0 DOCKER_OS: "debian:stretch" ARCH: "x86_64" - CI_IMAGE: "paritytech/ci-linux:production" + CI_IMAGE: "paritytech/ci-linux@sha256:f6cdc1e289e40f3eb1f93efb11f961d4f0e51f4c2adf80b31300ab5b35ef1386" # staging 2023-05-02 BUILDAH_IMAGE: "quay.io/buildah/stable:v1.29" BUILDAH_COMMAND: "buildah --storage-driver overlay2" RELENG_SCRIPTS_BRANCH: "master" diff --git a/client/network/sync/src/block_request_handler.rs b/client/network/sync/src/block_request_handler.rs index ece565aad4b09..256c0ad382b92 100644 --- a/client/network/sync/src/block_request_handler.rs +++ b/client/network/sync/src/block_request_handler.rs @@ -110,7 +110,7 @@ struct SeenRequestsKey { support_multiple_justifications: bool, } -#[allow(clippy::derive_hash_xor_eq)] +#[allow(clippy::derived_hash_with_manual_eq)] impl Hash for SeenRequestsKey { fn hash(&self, state: &mut H) { self.peer.hash(state); diff --git a/client/network/sync/src/state_request_handler.rs b/client/network/sync/src/state_request_handler.rs index 0ce2c541bf92e..93597453aa8a2 100644 --- a/client/network/sync/src/state_request_handler.rs +++ b/client/network/sync/src/state_request_handler.rs @@ -94,7 +94,7 @@ struct SeenRequestsKey { start: Vec>, } -#[allow(clippy::derive_hash_xor_eq)] +#[allow(clippy::derived_hash_with_manual_eq)] impl Hash for SeenRequestsKey { fn hash(&self, state: &mut H) { self.peer.hash(state); diff --git a/frame/support/test/tests/benchmark_ui/invalid_origin.stderr b/frame/support/test/tests/benchmark_ui/invalid_origin.stderr index ab8499d995d47..1818442b679a2 100644 --- a/frame/support/test/tests/benchmark_ui/invalid_origin.stderr +++ b/frame/support/test/tests/benchmark_ui/invalid_origin.stderr @@ -1,4 +1,4 @@ -error[E0599]: no variant or associated item named `new_call_variant_thing` found for enum `Call` in the current scope +error[E0599]: no variant or associated item named `new_call_variant_thing` found for enum `frame_support_test::Call` in the current scope --> tests/benchmark_ui/invalid_origin.rs:6:1 | 6 | #[benchmarks] diff --git a/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr b/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr index 1801379130913..a068cab4cb1ab 100644 --- a/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr +++ b/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr @@ -15,13 +15,14 @@ error: `Pallet` does not have #[pallet::inherent] defined, perhaps you should re | = note: this error originates in the macro `pallet::__substrate_inherent_check::is_inherent_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0599]: no function or associated item named `create_inherent` found for struct `Pallet` in the current scope +error[E0599]: no function or associated item named `create_inherent` found for struct `pallet::Pallet` in the current scope --> tests/construct_runtime_ui/undefined_inherent_part.rs:49:1 | 11 | pub struct Pallet(_); | -------------------- function or associated item `create_inherent` not found for this struct ... -49 | / construct_runtime! { +49 | construct_runtime! { + | _^ 50 | | pub struct Runtime where 51 | | Block = Block, 52 | | NodeBlock = Block, @@ -35,13 +36,14 @@ error[E0599]: no function or associated item named `create_inherent` found for s candidate #1: `ProvideInherent` = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0599]: no function or associated item named `is_inherent` found for struct `Pallet` in the current scope +error[E0599]: no function or associated item named `is_inherent` found for struct `pallet::Pallet` in the current scope --> tests/construct_runtime_ui/undefined_inherent_part.rs:49:1 | 11 | pub struct Pallet(_); | -------------------- function or associated item `is_inherent` not found for this struct ... -49 | / construct_runtime! { +49 | construct_runtime! { + | _^ 50 | | pub struct Runtime where 51 | | Block = Block, 52 | | NodeBlock = Block, @@ -55,13 +57,14 @@ error[E0599]: no function or associated item named `is_inherent` found for struc candidate #1: `ProvideInherent` = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0599]: no function or associated item named `check_inherent` found for struct `Pallet` in the current scope +error[E0599]: no function or associated item named `check_inherent` found for struct `pallet::Pallet` in the current scope --> tests/construct_runtime_ui/undefined_inherent_part.rs:49:1 | 11 | pub struct Pallet(_); | -------------------- function or associated item `check_inherent` not found for this struct ... -49 | / construct_runtime! { +49 | construct_runtime! { + | _^ 50 | | pub struct Runtime where 51 | | Block = Block, 52 | | NodeBlock = Block, @@ -75,13 +78,14 @@ error[E0599]: no function or associated item named `check_inherent` found for st candidate #1: `ProvideInherent` = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `Pallet` in the current scope +error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `pallet::Pallet` in the current scope --> tests/construct_runtime_ui/undefined_inherent_part.rs:49:1 | 11 | pub struct Pallet(_); | -------------------- associated item `INHERENT_IDENTIFIER` not found for this struct ... -49 | / construct_runtime! { +49 | construct_runtime! { + | _^ 50 | | pub struct Runtime where 51 | | Block = Block, 52 | | NodeBlock = Block, @@ -95,13 +99,14 @@ error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `P candidate #1: `ProvideInherent` = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0599]: no function or associated item named `is_inherent_required` found for struct `Pallet` in the current scope +error[E0599]: no function or associated item named `is_inherent_required` found for struct `pallet::Pallet` in the current scope --> tests/construct_runtime_ui/undefined_inherent_part.rs:49:1 | 11 | pub struct Pallet(_); | -------------------- function or associated item `is_inherent_required` not found for this struct ... -49 | / construct_runtime! { +49 | construct_runtime! { + | _^ 50 | | pub struct Runtime where 51 | | Block = Block, 52 | | NodeBlock = Block, diff --git a/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr b/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr index fa52ce2276635..84f1e54d5c24e 100644 --- a/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr +++ b/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr @@ -18,24 +18,28 @@ error: `Pallet` does not have #[pallet::validate_unsigned] defined, perhaps you error[E0599]: no variant or associated item named `Pallet` found for enum `RuntimeCall` in the current scope --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:56:3 | -49 | / construct_runtime! { -50 | | pub struct Runtime where -51 | | Block = Block, -52 | | NodeBlock = Block, -... | -56 | | Pallet: pallet::{Pallet, ValidateUnsigned}, - | | ^^^^^^ variant or associated item not found in `RuntimeCall` -57 | | } -58 | | } - | |_- variant or associated item `Pallet` not found for this enum +49 | // construct_runtime! { +50 | || pub struct Runtime where +51 | || Block = Block, +52 | || NodeBlock = Block, +... || +55 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, +56 | || Pallet: pallet::{Pallet, ValidateUnsigned}, + | || -^^^^^^ variant or associated item not found in `RuntimeCall` + | ||________| + | | +57 | | } +58 | | } + | |__- variant or associated item `Pallet` not found for this enum -error[E0599]: no function or associated item named `pre_dispatch` found for struct `Pallet` in the current scope +error[E0599]: no function or associated item named `pre_dispatch` found for struct `pallet::Pallet` in the current scope --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:49:1 | 11 | pub struct Pallet(_); | -------------------- function or associated item `pre_dispatch` not found for this struct ... -49 | / construct_runtime! { +49 | construct_runtime! { + | _^ 50 | | pub struct Runtime where 51 | | Block = Block, 52 | | NodeBlock = Block, @@ -50,13 +54,14 @@ error[E0599]: no function or associated item named `pre_dispatch` found for stru candidate #2: `ValidateUnsigned` = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0599]: no function or associated item named `validate_unsigned` found for struct `Pallet` in the current scope +error[E0599]: no function or associated item named `validate_unsigned` found for struct `pallet::Pallet` in the current scope --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:49:1 | 11 | pub struct Pallet(_); | -------------------- function or associated item `validate_unsigned` not found for this struct ... -49 | / construct_runtime! { +49 | construct_runtime! { + | _^ 50 | | pub struct Runtime where 51 | | Block = Block, 52 | | NodeBlock = Block, diff --git a/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.stderr b/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.stderr index 46872fc7c3691..fbde5c691c5a0 100644 --- a/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.stderr +++ b/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.stderr @@ -1,10 +1,10 @@ -error[E0599]: no function or associated item named `foo` found for associated type `::WeightInfo` in the current scope +error[E0599]: no function or associated item named `foo` found for associated type `::WeightInfo` in the current scope --> tests/pallet_ui/call_weight_inherited_invalid4.rs:24:10 | 24 | pub fn foo(_: OriginFor) -> DispatchResult { | ^^^ function or associated item not found in `::WeightInfo` -error[E0599]: no function or associated item named `foo` found for associated type `::WeightInfo` in the current scope +error[E0599]: no function or associated item named `foo` found for associated type `::WeightInfo` in the current scope --> tests/pallet_ui/call_weight_inherited_invalid4.rs:45:10 | 45 | pub fn foo(_: OriginFor) -> DispatchResult { diff --git a/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.stderr b/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.stderr index 4b4c78b148455..d955960c315b0 100644 --- a/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.stderr +++ b/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.stderr @@ -8,7 +8,7 @@ note: required by a bound in `pallet::Config` --> tests/pallet_ui/type_value_forgotten_where_clause.rs:8:51 | 7 | pub trait Config: frame_system::Config - | ------ required by a bound in this + | ------ required by a bound in this trait 8 | where ::AccountId: From | ^^^^^^^^^ required by this bound in `Config` help: consider further restricting the associated type @@ -26,7 +26,7 @@ note: required by a bound in `pallet::Config` --> tests/pallet_ui/type_value_forgotten_where_clause.rs:8:51 | 7 | pub trait Config: frame_system::Config - | ------ required by a bound in this + | ------ required by a bound in this trait 8 | where ::AccountId: From | ^^^^^^^^^ required by this bound in `Config` help: consider further restricting the associated type @@ -44,7 +44,7 @@ note: required by a bound in `pallet::Config` --> tests/pallet_ui/type_value_forgotten_where_clause.rs:8:51 | 7 | pub trait Config: frame_system::Config - | ------ required by a bound in this + | ------ required by a bound in this trait 8 | where ::AccountId: From | ^^^^^^^^^ required by this bound in `Config` help: consider further restricting the associated type diff --git a/primitives/api/test/tests/ui/impl_incorrect_method_signature.stderr b/primitives/api/test/tests/ui/impl_incorrect_method_signature.stderr index 5b36248228bff..ef82582079211 100644 --- a/primitives/api/test/tests/ui/impl_incorrect_method_signature.stderr +++ b/primitives/api/test/tests/ui/impl_incorrect_method_signature.stderr @@ -4,7 +4,7 @@ error[E0053]: method `test` has an incompatible type for trait 19 | fn test(data: String) {} | ^^^^^^ | | - | expected `u64`, found struct `String` + | expected `u64`, found `std::string::String` | help: change the parameter type to match the trait: `u64` | note: type in trait @@ -21,7 +21,7 @@ error[E0308]: mismatched types 17 | / sp_api::impl_runtime_apis! { 18 | | impl self::Api for Runtime { 19 | | fn test(data: String) {} - | | ^^^^ expected `u64`, found struct `String` + | | ^^^^ expected `u64`, found `String` 20 | | } ... | 32 | | }