Skip to content

chore: prepare for rustc version bump to v1.95.0#10637

Open
mraszyk wants to merge 2 commits into
masterfrom
mraszyk/prepare-for-rustc-1.95.0
Open

chore: prepare for rustc version bump to v1.95.0#10637
mraszyk wants to merge 2 commits into
masterfrom
mraszyk/prepare-for-rustc-1.95.0

Conversation

@mraszyk

@mraszyk mraszyk commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This PR prepares for a rustc version bump to v1.95.0 by making all the Rust changes required for the new version. It is a separate PR so that reverting the rustc version bump (if needed) does not create conflicts.

@github-actions github-actions Bot added the chore label Jul 2, 2026
@mraszyk mraszyk marked this pull request as ready for review July 2, 2026 13:06
@mraszyk mraszyk requested review from a team as code owners July 2, 2026 13:06

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. In the text entry box, respond to each of the numbered items in the previous
    section, declare one of the following:

  • Done.

  • $REASON_WHY_NO_NEED. E.g. for unreleased_changelog.md, "No
    canister behavior changes.", or for item 2, "Existing APIs
    behave as before.".

Brief Guide to "Externally Visible" Changes

"Externally visible behavior change" is very often due to some NEW canister API.

Changes to EXISTING APIs are more likely to be "breaking".

If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.

If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.

Reference(s)

For a more comprehensive checklist, see here.

GOVERNANCE_CHECKLIST_REMINDER_DEDUP

@zeropath-ai

zeropath-ai Bot commented Jul 2, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 0d8bf5f.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► packages/canlog/src/lib.rs
      Sort asc/desc using sort_by_key for timestamp
Enhancement ► rs/bitcoin/adapter/src/blockchainstate.rs
      Use sort_by_key with Reverse for work metric in tips
Enhancement ► rs/bitcoin/adapter/src/rpc_server.rs
      Add #[allow(clippy::result_large_err)] in TryFrom implementation
Enhancement ► rs/bitcoin/ckbtc/minter/src/lib.rs
      Iterate over fees directly when zipping with requests
Enhancement ► rs/bitcoin/ckbtc/minter/tests/tests.rs
      Sort records by index using sort_by_key
Enhancement ► rs/consensus/certification/src/certifier.rs
      Sort certs by height using sort_by_key
Enhancement ► rs/consensus/idkg/src/test_utils.rs
      Iterate dealings via.values() and map accordingly
Enhancement ► rs/crypto/internal/crypto_lib/threshold_sig/bls12_381/src/ni_dkg/fs_ni_dkg/nizk_chunking.rs
      Iterate with (delta_idx, e_i) and remove explicit delta_idx increment
Enhancement ► rs/crypto/tests/canister_threshold_idkg.rs
      Use target subnet_nodes directly in chain
Enhancement ► rs/ethereum/cketh/minter/src/logs.rs
      Sort logs by index using sort_by_key
Enhancement ► rs/ethereum/cketh/test_utils/src/lib.rs
      Sort records by idx using sort_by_key
Enhancement ► rs/ethereum/ledger-suite-orchestrator/src/logs/mod.rs
      Sort entries by timestamp using sort_by_key
Enhancement ► rs/execution_environment/src/scheduler/tests/scheduling.rs
      Compute required_rounds with checked_div and map_or for fallback 1
Enhancement ► rs/https_outcalls/consensus/src/pool_manager.rs
      Add #[allow(clippy::result_large_err)] in test context
Enhancement ► rs/interfaces/mocks/src/crypto.rs
      Add #[allow(clippy::result_large_err)]
Enhancement ► rs/ledger_suite/icp/index/src/main.rs
      Ignore explicit_counter_loop in block append
Enhancement ▼ Various files across repository (multiple paths) to consistently replace sort_by with sort_by_key and minor formatting/iteration adjustments in tests and utilities

@zeropath-ai

zeropath-ai Bot commented Jul 2, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 0d8bf5f.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► packages/canlog/src/lib.rs
    Refactor sort_asc and sort_desc to use sort_by_key for timestamps
► rs/bitcoin/adapter/src/blockchainstate.rs
    Sort tips by work using sort_by_key with Reverse for desc
► rs/bitcoin/adapter/src/rpc_server.rs
    Add #[allow(clippy::result_large_err)] in TryFrom implementation
► rs/bitcoin/ckbtc/minter/src/lib.rs
    Use zip with fees directly in reimbursement loop
► rs/bitcoin/ckbtc/minter/tests/tests.rs
    Sort records by idx using sort_by_key
► rs/consensus/certification/src/certifier.rs
    Sort certs by height using sort_by_key
► rs/consensus/idkg/src/test_utils.rs
    Iterate dealings via values() and map over dealing
► rs/crypto/internal/crypto_lib/threshold_sig/bls12_381/src/ni_dkg/fs_ni_dkg/nizk_chunking.rs
    Refactor delta_idx handling in loop using zip and remove manual increment
► rs/crypto/tests/canister_threshold_idkg.rs
    Adjust chaining of subnet_nodes in reshare tests to avoid into_iter()
► rs/ethereum/cketh/minter/src/logs.rs
    Sort logs by timestamp using sort_by_key
► rs/ethereum/cketh/test_utils/src/lib.rs
    Sort records by idx using sort_by_key
► rs/ethereum/ledger-suite-orchestrator/src/logs/mod.rs
    Sort entries by timestamp using sort_by_key
► rs/execution_environment/src/scheduler/tests/scheduling.rs
    Compute required_rounds using checked_div and map_or for default 1
► rs/https_outcalls/consensus/src/pool_manager.rs
    Add #[allow(clippy::result_large_err)] in test shim setup
► rs/interfaces/mocks/src/crypto.rs
    Add #[allow(clippy::result_large_err)] at crate level
► rs/ledger_suite/icp/index/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for block loop
► rs/ledger_suite/icp/index-ng/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for loop
► rs/ledger_suite/icrc1/archive/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for loop
► rs/ledger_suite/icrc1/index-ng/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for loop
► rs/ledger_suite/icrc1/index-ng/tests/tests.rs
    Adjust zip usage to remove into_iter()
► rs/ledger_suite/icrc1/ledger/tests/tests.rs
    Adjust zip usage to remove into_iter()
► rs/ledger_suite/tests/sm-tests/src/lib.rs
    Use zip with blocks directly in iteration
► rs/monitoring/adapter_metrics/server/src/lib.rs
    Add #[allow(clippy::result_large_err)] to scrape method
► rs/nervous_system/agent/src/sns/swap.rs
    Use direct iteration over new_sns_neuron_recipes.sns_neuron_recipes instead of into_iter
► rs/nns/governance/src/governance.rs
    Add #[allow(clippy::collapsible_match)] around Follow/SplitSubnet blocks
► rs/nns/governance/src/governance/benches.rs
    Chain not_voting_neuron_ids.clone() without into_iter()
► rs/nns/governance/tests/governance.rs
    Sort known_neurons by id using sort_by_key
► rs/nns/integration_tests/src/node_provider_remuneration.rs
    Use into_values() and map over node_ids in metrics collection
► rs/nns/test_utils/src/state_test_helpers.rs
    Extend neuron_infos directly instead of into_iter()
► rs/p2p/artifact_downloader/src/fetch_stripped_artifact/stripper.rs
    Use values() when iterating transcripts
► rs/p2p/consensus_manager/tests/test.rs
    Iterate over cms with zip of nodes and cms directly
► rs/p2p/state_sync_manager/tests/common.rs
    Iterate over keys() instead of iter and filter with contains_key
► rs/query_stats/src/payload_builder.rs
    Extend stat2Clone instead of stat2.clone().into_iter()
► rs/recovery/src/app_subnet_recovery.rs
    Add #[allow(clippy::collapsible_match)] on several StepType arms
► rs/recovery/src/nns_recovery_failover_nodes.rs
    Add #[allow(clippy::collapsible_match)] annotations around StepType arms
► rs/recovery/src/nns_recovery_same_nodes.rs
    Add #[allow(clippy::collapsible_match)] around StepType match arms
► rs/recovery/subnet_splitting/src/subnet_splitting.rs
    Add #[allow(clippy::collapsible_match)] around StepType arms
► rs/registry/canister/src/invariants/assignment.rs
    Use into_values() and flatten membership through flat_map
► rs/registry/canister/src/mutations/firewall.rs
    Sort tuples by key using sort_by_key instead of sort_by
► rs/registry/regedit/src/lib.rs
    Sort registry_changelogs by key with sort_by_key
► rs/replicated_state/src/canister_state/queues.rs
    Replace loop with while let Some(reference) to peek queue
► rs/rosetta-api/icp/ledger_canister_blocks_synchronizer/src/blocks.rs
    Sort transactions by block index using sort_by_key
► rs/rosetta-api/icp/src/request_handler.rs
    Sort transactions by block index in reverse using sort_by_key
► rs/rosetta-api/icrc1/src/data_api/services.rs
    Sort transactions by block index in reverse using sort_by_key
► rs/rosetta-api/icrc1/tests/multitoken_system_tests.rs
    Add #[allow(clippy::explicit_counter_loop)] before loop
► rs/rosetta-api/icrc1/tests/system_tests.rs
    Add #[allow(clippy::explicit_counter_loop)] before loop
► rs/rust_canisters/messaging_test/src/main.rs
    Change zip usage to zip with calls directly
► rs/sns/governance/src/following.rs
    Changed all_followees.extend to extend_followees_for_topic.followees
► rs/sns/governance/src/proposal.rs
    Use extend instead of into_iter for defects collection
► rs/state_machine_tests/src/lib.rs
    Use zip with contents directly instead of into_iter
► rs/state_manager/src/checkpoint.rs
    Use values() then flat_map for ref_snapshot_ids
► rs/tests/ckbtc/ckdoge_minter_basics_test.rs
    Add #[allow(clippy::collapsible_match)] for RetrieveDogeStatus variant
► rs/tests/ckbtc/src/adapter.rs
    Flatten results by chaining the iterator directly
► rs/tests/dre/utils/steps/update_subnet_type.rs
    Simplify thread join condition in if statement
► rs/tests/networking/http_endpoints_public_spec_test.rs
    No content for the added line (empty)

@zeropath-ai

zeropath-ai Bot commented Jul 2, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 0d8bf5f.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► packages/canlog/src/lib.rs
    Refactor sort_asc and sort_desc to use sort_by_key for timestamps
► rs/bitcoin/adapter/src/blockchainstate.rs
    Sort tips by work using sort_by_key with Reverse for desc
► rs/bitcoin/adapter/src/rpc_server.rs
    Add #[allow(clippy::result_large_err)] in TryFrom implementation
► rs/bitcoin/ckbtc/minter/src/lib.rs
    Use zip with fees directly in reimbursement loop
► rs/bitcoin/ckbtc/minter/tests/tests.rs
    Sort records by idx using sort_by_key
► rs/consensus/certification/src/certifier.rs
    Sort certs by height using sort_by_key
► rs/consensus/idkg/src/test_utils.rs
    Iterate dealings via values() and map over dealing
► rs/crypto/internal/crypto_lib/threshold_sig/bls12_381/src/ni_dkg/fs_ni_dkg/nizk_chunking.rs
    Refactor delta_idx handling in loop using zip and remove manual increment
► rs/crypto/tests/canister_threshold_idkg.rs
    Adjust chaining of subnet_nodes in reshare tests to avoid into_iter()
► rs/ethereum/cketh/minter/src/logs.rs
    Sort logs by timestamp using sort_by_key
► rs/ethereum/cketh/test_utils/src/lib.rs
    Sort records by idx using sort_by_key
► rs/ethereum/ledger-suite-orchestrator/src/logs/mod.rs
    Sort entries by timestamp using sort_by_key
► rs/execution_environment/src/scheduler/tests/scheduling.rs
    Compute required_rounds using checked_div and map_or for default 1
► rs/https_outcalls/consensus/src/pool_manager.rs
    Add #[allow(clippy::result_large_err)] in test shim setup
► rs/interfaces/mocks/src/crypto.rs
    Add #[allow(clippy::result_large_err)] at crate level
► rs/ledger_suite/icp/index/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for block loop
► rs/ledger_suite/icp/index-ng/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for loop
► rs/ledger_suite/icrc1/archive/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for loop
► rs/ledger_suite/icrc1/index-ng/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for loop
► rs/ledger_suite/icrc1/index-ng/tests/tests.rs
    Adjust zip usage to remove into_iter()
► rs/ledger_suite/icrc1/ledger/tests/tests.rs
    Adjust zip usage to remove into_iter()
► rs/ledger_suite/tests/sm-tests/src/lib.rs
    Use zip with blocks directly in iteration
► rs/monitoring/adapter_metrics/server/src/lib.rs
    Add #[allow(clippy::result_large_err)] to scrape method
► rs/nervous_system/agent/src/sns/swap.rs
    Use direct iteration over new_sns_neuron_recipes.sns_neuron_recipes instead of into_iter
► rs/nns/governance/src/governance.rs
    Add #[allow(clippy::collapsible_match)] around Follow/SplitSubnet blocks
► rs/nns/governance/src/governance/benches.rs
    Chain not_voting_neuron_ids.clone() without into_iter()
► rs/nns/governance/tests/governance.rs
    Sort known_neurons by id using sort_by_key
► rs/nns/integration_tests/src/node_provider_remuneration.rs
    Use into_values() and map over node_ids in metrics collection
► rs/nns/test_utils/src/state_test_helpers.rs
    Extend neuron_infos directly instead of into_iter()
► rs/p2p/artifact_downloader/src/fetch_stripped_artifact/stripper.rs
    Use values() when iterating transcripts
► rs/p2p/consensus_manager/tests/test.rs
    Iterate over cms with zip of nodes and cms directly
► rs/p2p/state_sync_manager/tests/common.rs
    Iterate over keys() instead of iter and filter with contains_key
► rs/query_stats/src/payload_builder.rs
    Extend stat2Clone instead of stat2.clone().into_iter()
► rs/recovery/src/app_subnet_recovery.rs
    Add #[allow(clippy::collapsible_match)] on several StepType arms
► rs/recovery/src/nns_recovery_failover_nodes.rs
    Add #[allow(clippy::collapsible_match)] annotations around StepType arms
► rs/recovery/src/nns_recovery_same_nodes.rs
    Add #[allow(clippy::collapsible_match)] around StepType match arms
► rs/recovery/subnet_splitting/src/subnet_splitting.rs
    Add #[allow(clippy::collapsible_match)] around StepType arms
► rs/registry/canister/src/invariants/assignment.rs
    Use into_values() and flatten membership through flat_map
► rs/registry/canister/src/mutations/firewall.rs
    Sort tuples by key using sort_by_key instead of sort_by
► rs/registry/regedit/src/lib.rs
    Sort registry_changelogs by key with sort_by_key
► rs/replicated_state/src/canister_state/queues.rs
    Replace loop with while let Some(reference) to peek queue
► rs/rosetta-api/icp/ledger_canister_blocks_synchronizer/src/blocks.rs
    Sort transactions by block index using sort_by_key
► rs/rosetta-api/icp/src/request_handler.rs
    Sort transactions by block index in reverse using sort_by_key
► rs/rosetta-api/icrc1/src/data_api/services.rs
    Sort transactions by block index in reverse using sort_by_key
► rs/rosetta-api/icrc1/tests/multitoken_system_tests.rs
    Add #[allow(clippy::explicit_counter_loop)] before loop
► rs/rosetta-api/icrc1/tests/system_tests.rs
    Add #[allow(clippy::explicit_counter_loop)] before loop
► rs/rust_canisters/messaging_test/src/main.rs
    Change zip usage to zip with calls directly
► rs/sns/governance/src/following.rs
    Changed all_followees.extend to extend_followees_for_topic.followees
► rs/sns/governance/src/proposal.rs
    Use extend instead of into_iter for defects collection
► rs/state_machine_tests/src/lib.rs
    Use zip with contents directly instead of into_iter
► rs/state_manager/src/checkpoint.rs
    Use values() then flat_map for ref_snapshot_ids
► rs/tests/ckbtc/ckdoge_minter_basics_test.rs
    Add #[allow(clippy::collapsible_match)] for RetrieveDogeStatus variant
► rs/tests/ckbtc/src/adapter.rs
    Flatten results by chaining the iterator directly
► rs/tests/dre/utils/steps/update_subnet_type.rs
    Simplify thread join condition in if statement
► rs/tests/networking/http_endpoints_public_spec_test.rs
    No content for the added line (empty)

@zeropath-ai

zeropath-ai Bot commented Jul 2, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 0d8bf5f.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► packages/canlog/src/lib.rs
      Sort asc/desc using sort_by_key for timestamp
Enhancement ► rs/bitcoin/adapter/src/blockchainstate.rs
      Use sort_by_key with Reverse for work metric in tips
Enhancement ► rs/bitcoin/adapter/src/rpc_server.rs
      Add #[allow(clippy::result_large_err)] in TryFrom implementation
Enhancement ► rs/bitcoin/ckbtc/minter/src/lib.rs
      Iterate over fees directly when zipping with requests
Enhancement ► rs/bitcoin/ckbtc/minter/tests/tests.rs
      Sort records by index using sort_by_key
Enhancement ► rs/consensus/certification/src/certifier.rs
      Sort certs by height using sort_by_key
Enhancement ► rs/consensus/idkg/src/test_utils.rs
      Iterate dealings via.values() and map accordingly
Enhancement ► rs/crypto/internal/crypto_lib/threshold_sig/bls12_381/src/ni_dkg/fs_ni_dkg/nizk_chunking.rs
      Iterate with (delta_idx, e_i) and remove explicit delta_idx increment
Enhancement ► rs/crypto/tests/canister_threshold_idkg.rs
      Use target subnet_nodes directly in chain
Enhancement ► rs/ethereum/cketh/minter/src/logs.rs
      Sort logs by index using sort_by_key
Enhancement ► rs/ethereum/cketh/test_utils/src/lib.rs
      Sort records by idx using sort_by_key
Enhancement ► rs/ethereum/ledger-suite-orchestrator/src/logs/mod.rs
      Sort entries by timestamp using sort_by_key
Enhancement ► rs/execution_environment/src/scheduler/tests/scheduling.rs
      Compute required_rounds with checked_div and map_or for fallback 1
Enhancement ► rs/https_outcalls/consensus/src/pool_manager.rs
      Add #[allow(clippy::result_large_err)] in test context
Enhancement ► rs/interfaces/mocks/src/crypto.rs
      Add #[allow(clippy::result_large_err)]
Enhancement ► rs/ledger_suite/icp/index/src/main.rs
      Ignore explicit_counter_loop in block append
Enhancement ▼ Various files across repository (multiple paths) to consistently replace sort_by with sort_by_key and minor formatting/iteration adjustments in tests and utilities

@zeropath-ai

zeropath-ai Bot commented Jul 2, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 0d8bf5f.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► packages/canlog/src/lib.rs
    Refactor sort_asc and sort_desc to use sort_by_key for timestamps
► rs/bitcoin/adapter/src/blockchainstate.rs
    Sort tips by work using sort_by_key with Reverse for desc
► rs/bitcoin/adapter/src/rpc_server.rs
    Add #[allow(clippy::result_large_err)] in TryFrom implementation
► rs/bitcoin/ckbtc/minter/src/lib.rs
    Use zip with fees directly in reimbursement loop
► rs/bitcoin/ckbtc/minter/tests/tests.rs
    Sort records by idx using sort_by_key
► rs/consensus/certification/src/certifier.rs
    Sort certs by height using sort_by_key
► rs/consensus/idkg/src/test_utils.rs
    Iterate dealings via values() and map over dealing
► rs/crypto/internal/crypto_lib/threshold_sig/bls12_381/src/ni_dkg/fs_ni_dkg/nizk_chunking.rs
    Refactor delta_idx handling in loop using zip and remove manual increment
► rs/crypto/tests/canister_threshold_idkg.rs
    Adjust chaining of subnet_nodes in reshare tests to avoid into_iter()
► rs/ethereum/cketh/minter/src/logs.rs
    Sort logs by timestamp using sort_by_key
► rs/ethereum/cketh/test_utils/src/lib.rs
    Sort records by idx using sort_by_key
► rs/ethereum/ledger-suite-orchestrator/src/logs/mod.rs
    Sort entries by timestamp using sort_by_key
► rs/execution_environment/src/scheduler/tests/scheduling.rs
    Compute required_rounds using checked_div and map_or for default 1
► rs/https_outcalls/consensus/src/pool_manager.rs
    Add #[allow(clippy::result_large_err)] in test shim setup
► rs/interfaces/mocks/src/crypto.rs
    Add #[allow(clippy::result_large_err)] at crate level
► rs/ledger_suite/icp/index/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for block loop
► rs/ledger_suite/icp/index-ng/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for loop
► rs/ledger_suite/icrc1/archive/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for loop
► rs/ledger_suite/icrc1/index-ng/src/main.rs
    Add #[allow(clippy::explicit_counter_loop)] for loop
► rs/ledger_suite/icrc1/index-ng/tests/tests.rs
    Adjust zip usage to remove into_iter()
► rs/ledger_suite/icrc1/ledger/tests/tests.rs
    Adjust zip usage to remove into_iter()
► rs/ledger_suite/tests/sm-tests/src/lib.rs
    Use zip with blocks directly in iteration
► rs/monitoring/adapter_metrics/server/src/lib.rs
    Add #[allow(clippy::result_large_err)] to scrape method
► rs/nervous_system/agent/src/sns/swap.rs
    Use direct iteration over new_sns_neuron_recipes.sns_neuron_recipes instead of into_iter
► rs/nns/governance/src/governance.rs
    Add #[allow(clippy::collapsible_match)] around Follow/SplitSubnet blocks
► rs/nns/governance/src/governance/benches.rs
    Chain not_voting_neuron_ids.clone() without into_iter()
► rs/nns/governance/tests/governance.rs
    Sort known_neurons by id using sort_by_key
► rs/nns/integration_tests/src/node_provider_remuneration.rs
    Use into_values() and map over node_ids in metrics collection
► rs/nns/test_utils/src/state_test_helpers.rs
    Extend neuron_infos directly instead of into_iter()
► rs/p2p/artifact_downloader/src/fetch_stripped_artifact/stripper.rs
    Use values() when iterating transcripts
► rs/p2p/consensus_manager/tests/test.rs
    Iterate over cms with zip of nodes and cms directly
► rs/p2p/state_sync_manager/tests/common.rs
    Iterate over keys() instead of iter and filter with contains_key
► rs/query_stats/src/payload_builder.rs
    Extend stat2Clone instead of stat2.clone().into_iter()
► rs/recovery/src/app_subnet_recovery.rs
    Add #[allow(clippy::collapsible_match)] on several StepType arms
► rs/recovery/src/nns_recovery_failover_nodes.rs
    Add #[allow(clippy::collapsible_match)] annotations around StepType arms
► rs/recovery/src/nns_recovery_same_nodes.rs
    Add #[allow(clippy::collapsible_match)] around StepType match arms
► rs/recovery/subnet_splitting/src/subnet_splitting.rs
    Add #[allow(clippy::collapsible_match)] around StepType arms
► rs/registry/canister/src/invariants/assignment.rs
    Use into_values() and flatten membership through flat_map
► rs/registry/canister/src/mutations/firewall.rs
    Sort tuples by key using sort_by_key instead of sort_by
► rs/registry/regedit/src/lib.rs
    Sort registry_changelogs by key with sort_by_key
► rs/replicated_state/src/canister_state/queues.rs
    Replace loop with while let Some(reference) to peek queue
► rs/rosetta-api/icp/ledger_canister_blocks_synchronizer/src/blocks.rs
    Sort transactions by block index using sort_by_key
► rs/rosetta-api/icp/src/request_handler.rs
    Sort transactions by block index in reverse using sort_by_key
► rs/rosetta-api/icrc1/src/data_api/services.rs
    Sort transactions by block index in reverse using sort_by_key
► rs/rosetta-api/icrc1/tests/multitoken_system_tests.rs
    Add #[allow(clippy::explicit_counter_loop)] before loop
► rs/rosetta-api/icrc1/tests/system_tests.rs
    Add #[allow(clippy::explicit_counter_loop)] before loop
► rs/rust_canisters/messaging_test/src/main.rs
    Change zip usage to zip with calls directly
► rs/sns/governance/src/following.rs
    Changed all_followees.extend to extend_followees_for_topic.followees
► rs/sns/governance/src/proposal.rs
    Use extend instead of into_iter for defects collection
► rs/state_machine_tests/src/lib.rs
    Use zip with contents directly instead of into_iter
► rs/state_manager/src/checkpoint.rs
    Use values() then flat_map for ref_snapshot_ids
► rs/tests/ckbtc/ckdoge_minter_basics_test.rs
    Add #[allow(clippy::collapsible_match)] for RetrieveDogeStatus variant
► rs/tests/ckbtc/src/adapter.rs
    Flatten results by chaining the iterator directly
► rs/tests/dre/utils/steps/update_subnet_type.rs
    Simplify thread join condition in if statement
► rs/tests/networking/http_endpoints_public_spec_test.rs
    No content for the added line (empty)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 prepares the codebase for a Rust toolchain bump to rustc v1.95.0 by applying mechanical Rust changes (iterator ergonomics, sorting helpers, safer division) and adding narrowly scoped Clippy allowances where new lints would otherwise block the build.

Changes:

  • Replace manual if denom != 0 { num / denom } patterns with checked_div(...).map_or/unwrap_or(...) to satisfy newer lints and avoid div-by-zero.
  • Simplify iterator usage (.into_iter() elision, .values() / .into_values(), .keys(), .extend(...)) to match newer trait/iterator expectations.
  • Replace comparator closures with sort_by_key (and Reverse) and add targeted #[allow(clippy::...)] where needed.

Reviewed changes

Copilot reviewed 61 out of 61 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rs/xnet/payload_builder/src/proximity.rs Use checked_div for mean weight
rs/types/types/src/consensus/idkg.rs Use .values() to iterate configs
rs/tests/networking/http_endpoints_public_spec_test.rs Simplify extend usage
rs/tests/message_routing/xnet/slo_test_lib/xnet_slo_test_lib.rs Safe avg latency via checked_div
rs/tests/dre/utils/steps/update_subnet_type.rs Remove redundant into_iter()
rs/tests/ckbtc/src/adapter.rs Simplify chain(results) iteration
rs/tests/ckbtc/ckdoge_minter_basics_test.rs Use match guard for condition
rs/state_manager/src/checkpoint.rs Use .values() for snapshot ids
rs/state_machine_tests/src/lib.rs Simplify zip iterator inputs
rs/sns/governance/src/proposal.rs Simplify extend iterator inputs
rs/sns/governance/src/following.rs Simplify extend iterator inputs
rs/rust_canisters/messaging_test/src/main.rs Simplify zip(calls) iteration
rs/rosetta-api/icrc1/tests/system_tests.rs Allow Clippy explicit counter loop
rs/rosetta-api/icrc1/tests/multitoken_system_tests.rs Allow Clippy explicit counter loop
rs/rosetta-api/icrc1/src/data_api/services.rs Use sort_by_key(Reverse(..))
rs/rosetta-api/icp/src/request_handler.rs Use sort_by_key(Reverse(..))
rs/rosetta-api/icp/ledger_canister_blocks_synchronizer/src/blocks.rs Use sort_by_key for tuples
rs/replicated_state/src/canister_state/queues.rs Use while let Some(..) loop
rs/registry/regedit/src/lib.rs Use sort_by_key for versions
rs/registry/canister/src/mutations/firewall.rs Use sort_by_key for stable sort
rs/registry/canister/src/invariants/assignment.rs Use .into_values() for membership
rs/recovery/subnet_splitting/src/subnet_splitting.rs Use match guards for prompts
rs/recovery/src/nns_recovery_same_nodes.rs Use match guards for prompts
rs/recovery/src/nns_recovery_failover_nodes.rs Use match guards for prompts
rs/recovery/src/app_subnet_recovery.rs Use match guards for prompts
rs/query_stats/src/payload_builder.rs Simplify extend(stat2.clone())
rs/p2p/state_sync_manager/tests/common.rs Use .keys().filter(..) pattern
rs/p2p/consensus_manager/tests/test.rs Simplify zip(cms) iteration
rs/p2p/artifact_downloader/src/fetch_stripped_artifact/stripper.rs Use .values() over map entries
rs/nns/test_utils/src/state_test_helpers.rs Simplify extend(new_response...)
rs/nns/integration_tests/src/node_provider_remuneration.rs Use .into_values() for nodes map
rs/nns/governance/tests/governance.rs Use sort_by_key for neuron ids
rs/nns/governance/src/governance/benches.rs Simplify .chain(clone()) iteration
rs/nns/governance/src/governance.rs Use match guards for validation
rs/nns/cmc/src/main.rs Use checked_div for average rate
rs/nervous_system/integration_tests/tests/sns_lifecycle.rs Simplify stream iter + sort key
rs/nervous_system/agent/src/sns/swap.rs Simplify extend(...) iteration
rs/monitoring/adapter_metrics/server/src/lib.rs Allow Clippy result_large_err
rs/ledger_suite/tests/sm-tests/src/lib.rs Simplify chain/zip iterator inputs
rs/ledger_suite/icrc1/ledger/tests/tests.rs Simplify zip(expected_res.blocks)
rs/ledger_suite/icrc1/index-ng/tests/tests.rs Simplify zip(index_blocks.blocks)
rs/ledger_suite/icrc1/index-ng/src/main.rs Allow Clippy explicit counter loop
rs/ledger_suite/icrc1/archive/src/main.rs Allow Clippy explicit counter loop
rs/ledger_suite/icp/ledger/tests/tests.rs Simplify zip and iteration
rs/ledger_suite/icp/index/tests/tests.rs Simplify zip iteration
rs/ledger_suite/icp/index/src/main.rs Allow Clippy explicit counter loop
rs/interfaces/mocks/src/crypto.rs Crate-level allow result_large_err
rs/https_outcalls/consensus/src/pool_manager.rs Allow result_large_err in test
rs/execution_environment/src/scheduler/tests/scheduling.rs Use checked_div for rounds
rs/ethereum/ledger-suite-orchestrator/src/logs/mod.rs Use sort_by_key + Reverse
rs/ethereum/cketh/test_utils/src/lib.rs Use sort_by_key for log idx
rs/ethereum/cketh/minter/src/logs.rs Use sort_by_key + Reverse
rs/crypto/tests/canister_threshold_idkg.rs Simplify .chain(target_subnet_nodes)
rs/crypto/internal/crypto_lib/threshold_sig/bls12_381/src/ni_dkg/fs_ni_dkg/nizk_chunking.rs Replace manual counter with zip
rs/consensus/idkg/src/test_utils.rs Use .values() over map entries
rs/consensus/certification/src/certifier.rs Use sort_by_key for heights
rs/bitcoin/ckbtc/minter/tests/tests.rs Use sort_by_key for log idx
rs/bitcoin/ckbtc/minter/src/lib.rs Simplify zip(fees) iteration
rs/bitcoin/adapter/src/rpc_server.rs Allow result_large_err for TryFrom
rs/bitcoin/adapter/src/blockchainstate.rs Use sort_by_key(Reverse(..))
packages/canlog/src/lib.rs Use sort_by_key + Reverse

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a duplicate? The changes here look very familiar...

@mraszyk

mraszyk commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Is this a duplicate? The changes here look very familiar...

Bas proposed to split out the Rust code changes to avoid conflicts if the Rust compiler version bump needs to be reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants