Conversation
Use pattern matching instead of checking is_some()/is_none() before calling unwrap(). This is more idiomatic Rust.
Make elided lifetimes explicit to avoid confusion. The hidden lifetime lint was added to prevent cases where a lifetime is used in return types but not visible in the function signature.
Replace manual Default implementation with #[derive(Default)] and
Remove unused imports flagged by clippy: - crate::log in nomination-pools migration - vec macro in state-trie-migration and snowbridge - super::* in test modules
Remove unnecessary parentheses around: - Closure bodies (e.g., |x| (x.clone()) -> |x| x.clone()) - impl Trait types in function parameters - dyn trait types in Box casts - Method call arguments
Add #[allow(dead_code)] to structs, traits, and enums in test/mock code that are required for trait implementations but never directly constructed. Also add #![allow(unused_assignments)] for pallet::tasks_experimental macro-generated code that assigns to task parameters before passing them to the task function.
Replace manual modulo divisibility checks with the more idiomatic is_multiple_of() method introduced in Rust 1.92: - x % n == 0 -> x.is_multiple_of(n) - x % n != 0 -> !x.is_multiple_of(n) This addresses the clippy::manual_is_multiple_of lint.
|
/cmd fmt |
The `vec!` macro is only used in test modules which compile with std (where it's in the prelude), so these imports are unused in the main module.
The `decoded` variable was modified but never used - the code re-decoded from the original bytes instead of using the modified value.
Differential Tests Results (PolkaVM)Specified Tests
Counts
FailuresThe test specifiers seen in this section have the format 'path::case_idx::compilation_mode' and they're compatible with the revive differential tests framework and can be specified to it directly in the same way that they're provided through the The failures are provided in an expandable section to ensure that the PR does not get polluted with information. Please click on the section below for more information Detailed Differential Tests Failure Information
|
In no_std environments, the `vec!` macro must be explicitly imported from `alloc::vec` as it is not automatically brought into scope when importing `alloc::vec::Vec`.
|
/cmd --help |
|
Command "update-ui" has started 🚀 See logs here |
|
Command "update-ui" has finished ✅ See logs here |
Rust 1.93 has stricter rustdoc that now catches broken intra-doc links that were previously undetected. Fix all broken links across the workspace: - Wrap hyphenated crate names in backticks (not valid Rust paths) - Fix period placement outside of doc link brackets - Wrap types containing <T> in backticks to avoid HTML tag parsing - Wrap version numbers in backticks to avoid link resolution Files fixed: - substrate/frame/staking/src/pallet/impls.rs - substrate/frame/staking/src/pallet/mod.rs - substrate/frame/tips/src/lib.rs - bridges/primitives/polkadot-core/src/lib.rs - substrate/frame/assets-holder/src/lib.rs - substrate/frame/contracts/src/wasm/runtime.rs - substrate/frame/transaction-payment/asset-tx-payment/src/lib.rs - substrate/frame/transaction-payment/asset-conversion-tx-payment/src/lib.rs - substrate/frame/elections-phragmen/src/migrations/v3.rs - substrate/frame/elections-phragmen/src/migrations/v4.rs Also adds prdoc/pr_10816.prdoc with 54 crates.
Rust 1.93 changes which syscalls the PVF prepare worker uses: - Added: lstat(6), dup(32), nanosleep(35), sendto(44) - Removed: gettid(186)
| 158 (arch_prctl) | ||
| 165 (mount) | ||
| 166 (umount2) | ||
| 186 (gettid) |
There was a problem hiding this comment.
This is safe to always unconditionally enable, so hardcode this in the script so that it's always emitted (that way we'll be compatible with both new Rust and old Rust versions).
Summary
This PR fixes all new clippy warnings introduced when upgrading from Rust 1.88 to Rust 1.92.
Changes
1. Use
is_multiple_of()instead of manual modulo checksReplace manual modulo divisibility checks with the more idiomatic
is_multiple_of()method:x % n == 0→x.is_multiple_of(n)x % n != 0→!x.is_multiple_of(n)2. Resolve
unnecessary_unwrapwarningsUse pattern matching instead of checking
is_some()/is_none()before callingunwrap():3. Resolve
hidden_lifetimewarningsMake elided lifetimes explicit to avoid confusion when lifetimes are used in return types but not visible in function signatures.
4. Derive
Defaultinstead of manual implementationReplace manual
Defaultimpl with#[derive(Default)]and#[default]attribute forRingMembersStateenum.5. Remove unused imports
Remove unused imports of
crate::log,vecmacro,sp_std::vec, andsuper::*in test modules.6. Remove unnecessary parentheses
Remove unnecessary parentheses around:
|x| (x.clone())→|x| x.clone()impl Traittypes in function parametersdyntrait types inBoxcasts7. Suppress dead code warnings in tests and mocks
Add
#[allow(dead_code)]to structs, traits, and enums in test/mock code that are required for trait implementations but never directly constructed. Also add#![allow(unused_assignments)]forpallet::tasks_experimentalmacro-generated code.