Skip to content

fix: clippy 1.100 lint (needless_range_loop) - #3041

Merged
bergkvist merged 1 commit into
mainfrom
tobias/fix-clippy-1.100
Nov 18, 2026
Merged

bergkvist merged 1 commit into
mainfrom
tobias/fix-clippy-1.100

Conversation

@bergkvist

Copy link
Copy Markdown
Contributor

Summary

The WHIR prover loop iterates over config.round_parameters with enumerate(). It no longer indexes the list with a range variable.

Motivation

The lint job uses stable Rust. Clippy from Rust 1.100 reports needless_range_loop for this loop, and the job fails on every new PR (for example #3040). The loop keeps the same order and the same number of rounds, because n_rounds is the length of config.round_parameters.

Validation

cargo +1.100 clippy --all-features --all-targets -- -D warnings -A incomplete-features passes locally with SP1_CUDA_ENABLED=0, which matches the lint runner. Before the change, it failed with this one error. cargo +1.100 fmt --all -- --check passes.

@github-actions

Copy link
Copy Markdown
Contributor
Test Old New Diff
k256_test_schnorr_verify 5778460 5761618 -0.2915 %
curve25519_dalek_test_decompressed_noncanonical 7725 7725 0.0000 %
bls12_381_tests_test_bls_add_100 10355715 10355715 0.0000 %
bn_test_field_checks 31646 31646 0.0000 %
sha_test_sha2_v0_10_9_expected_digest_lte_100_times 1343116 1337461 -0.4210 %
bn_test_bn_test_g1_mul_zero 47803 47803 0.0000 %
secp256k1_program_test_recover_v0_30_0_rand_lte_100 5501012 5522826 0.3965 %
k256_test_recover_high_hash_high_recid 1840103 1818777 -1.1590 %
secp256k1_program_test_verify_v0_30_0_rand_lte_100 17122784 17112696 -0.0589 %
rustcrypto_bigint_test_bigint_mul_mod_special 1717435 1717435 0.0000 %
p256_test_recover_high_hash_high_recid 5895625 5286991 -10.3235 %
p256_test_recover_pubkey_infinity 98144 98144 0.0000 %
rustcrypto_bigint_test_bigint_mul_add_residue 2042576 2042576 0.0000 %
sha_test_sha2_v0_9_9_expected_digest_lte_100_times 1259579 1255771 -0.3023 %
bls12_381_tests_test_sqrt_fp2_100 1577350 1819159 15.3301 %
secp256k1_program_test_recover_rand_lte_100 5530762 5525818 -0.0894 %
bls12_381_tests_test_bls_double_100 6284517 6284517 0.0000 %
curve25519_dalek_test_decompressed_expected_value 4587863 4549819 -0.8292 %
curve25519_dalek_ng_test_decompressed_noncanonical 189834 189834 0.0000 %
curve25519_dalek_test_zero_msm 83427 83427 0.0000 %
bn_test_bn_test_g1_msm_edge 375798 375798 0.0000 %
curve25519_dalek_ng_test_zero_msm 125133 125133 0.0000 %
p256_test_field_checks 47543 47543 0.0000 %
sha_test_sha2_v0_11_0_expected_digest_lte_100_times 1331006 1330676 -0.0248 %
k256_test_point_ops_edge_cases 40933 40933 0.0000 %
k256_test_verify_rand_lte_100 11775562 11778756 0.0271 %
rust_crypto_rsa_test_pkcs_verify_100 29126011 29288806 0.5589 %
curve25519_dalek_ng_test_zero_mul 107750 107750 0.0000 %
p256_test_recover_rand_lte_100 15959672 15944595 -0.0945 %
bn_test_bn_test_g1_add_100 988645 988624 -0.0021 %
bn_test_bn_test_g1_add_neg 291962 291962 0.0000 %
sha_test_sha3_expected_digest_lte_100_times 1176329 1176549 0.0187 %
curve25519_dalek_ng_test_add_then_multiply 4008861 4651042 16.0190 %
bn_test_bn_test_fq_partial_ord 184528 184528 0.0000 %
p256_test_verify_rand_lte_100 12088402 12056844 -0.2611 %
keccack_test_expected_digest_lte_100 1713151 1710243 -0.1697 %
secp256k1_program_test_verify_rand_lte_100 17103060 17131086 0.1639 %
k256_test_field_checks 40519 40519 0.0000 %
bls12_381_tests_test_field_checks 29324 29324 0.0000 %
bn_test_bn_test_fq_inverse_100 786417 786417 0.0000 %
bn_test_bn_test_g1_double_100 728704 728704 0.0000 %
bn_test_bn_test_fr_inverse_100 803517 803517 0.0000 %
sha_test_sha2_v0_10_8_expected_digest_lte_100_times 1342529 1344492 0.1462 %
bls12_381_tests_test_inverse_fp_100 1197070 1197070 0.0000 %
curve25519_dalek_test_zero_mul 71838 71838 0.0000 %
p256_test_point_checks 347502 347502 0.0000 %
curve25519_dalek_test_add_then_multiply 3065660 2592177 -15.4447 %
bn_test_bn_test_fq_sqrt_100 787361 787337 -0.0030 %
curve25519_dalek_test_ed25519_verify 12940075 12940421 0.0027 %
k256_test_recover_rand_lte_100 4421066 4435852 0.3344 %
k256_test_recover_pubkey_infinity 98610 98610 0.0000 %
sha_test_sha2_v0_10_6_expected_digest_lte_100_times 1346985 1344067 -0.2166 %
bls12_381_tests_test_inverse_fp2_100 2216948 2216948 0.0000 %
bls12_381_tests_test_v2_field_checks 29324 29324 0.0000 %
bls12_381_tests_test_point_checks 797024 797024 0.0000 %
bls12_381_tests_test_sqrt_fp_100 878248 904474 2.9862 %
bls12_381_tests_test_v2_point_checks 1738384 1738384 0.0000 %

@fakedev9999 fakedev9999 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.

lgtm

@bergkvist
bergkvist merged commit ad18f1a into main Nov 18, 2026
23 of 24 checks passed
@bergkvist
bergkvist deleted the tobias/fix-clippy-1.100 branch November 18, 2026 15:25
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.

2 participants