-
Notifications
You must be signed in to change notification settings - Fork 124
chore: Fix rustc 1.91.1 warnings #3085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: nightly
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses Rust compiler warnings introduced in rustc 1.91.1 by making forward-compatible changes that work with both Rust 1.88 and 1.91.1. The changes modernize the codebase to align with newer Rust idioms and compiler expectations without introducing breaking changes.
Key changes include:
- Explicit lifetime annotations in function return types to satisfy stricter lifetime elision rules
- Reordering of
OrdandPartialOrdtrait implementations to follow the idiomatic pattern - Replacing manual
Defaultimplementation with derive macro using#[default]attribute - Using
is_multiple_ofmethod instead of modulo operator for divisibility checks
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/sovereign-sdk/rollup-interface/src/state_machine/da.rs | Reorders Ord and PartialOrd implementations to follow idiomatic pattern where PartialOrd delegates to Ord |
| crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs | Adds explicit lifetime annotations to accessory_state and offchain_state return types |
| crates/sovereign-sdk/module-system/sov-modules-api/src/lib.rs | Simplifies HashMap type parameter by removing redundant parentheses around trait object |
| crates/sovereign-sdk/full-node/db/sov-schema-db/tests/iterator_test.rs | Adds explicit lifetime annotations to iter and rev_iter return types |
| crates/sovereign-sdk/full-node/db/sov-schema-db/src/schema_batch.rs | Adds explicit lifetime annotations to iterator return types in iter and iter_range methods |
| crates/sovereign-sdk/full-node/db/sov-schema-db/src/lib.rs | Adds explicit lifetime annotations to various iterator-returning methods |
| crates/light-client-prover/src/circuit/initial_values.rs | Adds explicit lifetime annotations to initial_batch_proof_method_ids return types |
| crates/bitcoin-da/src/service.rs | Replaces manual Default implementation with derive macro using #[default] attribute |
| crates/bitcoin-da/src/helpers/merkle_tree.rs | Replaces % 2 == 0 with is_multiple_of(2) method for divisibility check |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bb02831 to
031e3d3
Compare
Description
This is a forward compatible fix of warnings for rustc 1.91.1. This change produces no warnings neither for
1.88nor1.91.1, so it is safe to use1.91.1locally without upgrading the CI and ecosystem to1.91.1:Fixes
Recent rust-analyzer upgrade.