Skip to content

Conversation

@kpp
Copy link
Contributor

@kpp kpp commented Dec 17, 2025

Description

This is a forward compatible fix of warnings for rustc 1.91.1. This change produces no warnings neither for 1.88 nor 1.91.1, so it is safe to use 1.91.1 locally without upgrading the CI and ecosystem to 1.91.1:

$ git diff rust-toolchain.toml
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 0498c6bf5..4f5fb39a0 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,4 +1,4 @@
 [toolchain]
-channel = "1.88"
+channel = "1.91.1"
 components = ["rustfmt", "rust-src", "clippy"]
 profile = "minimal"

Fixes

Recent rust-analyzer upgrade.

Copilot AI review requested due to automatic review settings December 17, 2025 04:01
@kpp kpp requested a review from a team as a code owner December 17, 2025 04:01
@auto-assign auto-assign bot requested a review from jfldde December 17, 2025 04:02
@kpp kpp changed the title Fix rustc 1.91.1 warnings chore: Fix rustc 1.91.1 warnings Dec 17, 2025
Copy link
Contributor

Copilot AI left a 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 Ord and PartialOrd trait implementations to follow the idiomatic pattern
  • Replacing manual Default implementation with derive macro using #[default] attribute
  • Using is_multiple_of method 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.

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.6%. Comparing base (f8622d5) to head (031e3d3).

Files with missing lines Patch % Lines
.../light-client-prover/src/circuit/initial_values.rs 50.0% 1 Missing ⚠️
...overeign-sdk/full-node/db/sov-schema-db/src/lib.rs 75.0% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
crates/bitcoin-da/src/helpers/merkle_tree.rs 100.0% <100.0%> (ø)
crates/bitcoin-da/src/service.rs 84.0% <ø> (-0.1%) ⬇️
...sdk/full-node/db/sov-schema-db/src/schema_batch.rs 100.0% <100.0%> (ø)
...reign-sdk/module-system/sov-modules-api/src/lib.rs 100.0% <100.0%> (ø)
...-system/sov-modules-core/src/storage/scratchpad.rs 92.8% <100.0%> (ø)
...reign-sdk/rollup-interface/src/state_machine/da.rs 69.3% <100.0%> (+3.4%) ⬆️
.../light-client-prover/src/circuit/initial_values.rs 47.2% <50.0%> (ø)
...overeign-sdk/full-node/db/sov-schema-db/src/lib.rs 78.0% <75.0%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kpp kpp force-pushed the kpp/fix_warnings_rust191 branch from bb02831 to 031e3d3 Compare December 17, 2025 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants