From 14c40115934c2741e4c34235ebbb4a0ed531009b Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Fri, 7 Jul 2023 12:16:43 -0700 Subject: [PATCH] Revert "clippy fixes" --- evm/src/cpu/gas.rs | 2 -- evm/src/cpu/kernel/tests/bignum/mod.rs | 2 +- evm/src/cpu/memio.rs | 2 -- evm/src/cpu/stack.rs | 2 -- evm/src/recursive_verifier.rs | 2 +- field/Cargo.toml | 2 +- plonky2/Cargo.toml | 2 +- plonky2/src/fri/prover.rs | 2 +- plonky2/src/gates/selectors.rs | 1 - plonky2/src/iop/challenger.rs | 4 ++-- starky/Cargo.toml | 2 +- 11 files changed, 8 insertions(+), 15 deletions(-) diff --git a/evm/src/cpu/gas.rs b/evm/src/cpu/gas.rs index 40cee3b9..9fb32298 100644 --- a/evm/src/cpu/gas.rs +++ b/evm/src/cpu/gas.rs @@ -60,7 +60,6 @@ const SIMPLE_OPCODES: OpsColumnsView> = OpsColumnsView { exception: None, }; -#[allow(clippy::useless_conversion)] // For izip! macro. fn eval_packed_accumulate( lv: &CpuColumnsView

, nv: &CpuColumnsView

, @@ -119,7 +118,6 @@ pub fn eval_packed( eval_packed_init(lv, nv, yield_constr); } -#[allow(clippy::useless_conversion)] // For izip! macro. fn eval_ext_circuit_accumulate, const D: usize>( builder: &mut plonky2::plonk::circuit_builder::CircuitBuilder, lv: &CpuColumnsView>, diff --git a/evm/src/cpu/kernel/tests/bignum/mod.rs b/evm/src/cpu/kernel/tests/bignum/mod.rs index 9e15d96f..f7ba2206 100644 --- a/evm/src/cpu/kernel/tests/bignum/mod.rs +++ b/evm/src/cpu/kernel/tests/bignum/mod.rs @@ -188,7 +188,7 @@ fn test_add_bignum(a: BigUint, b: BigUint, expected_output: BigUint) -> Result<( fn test_addmul_bignum(a: BigUint, b: BigUint, c: u128, expected_output: BigUint) -> Result<()> { let len = bignum_len(&a).max(bignum_len(&b)); let mut memory = pad_bignums(&[a, b], len); - memory.splice(len..len, [0.into(); 2].iter().cloned()); + memory.splice(len..len, vec![0.into(); 2].iter().cloned()); let a_start_loc = 0; let b_start_loc = len + 2; diff --git a/evm/src/cpu/memio.rs b/evm/src/cpu/memio.rs index d33fb66e..09490e87 100644 --- a/evm/src/cpu/memio.rs +++ b/evm/src/cpu/memio.rs @@ -40,7 +40,6 @@ fn eval_packed_load( } } -#[allow(clippy::tuple_array_conversions)] // For izip! macro. fn eval_ext_circuit_load, const D: usize>( builder: &mut plonky2::plonk::circuit_builder::CircuitBuilder, lv: &CpuColumnsView>, @@ -110,7 +109,6 @@ fn eval_packed_store( } } -#[allow(clippy::tuple_array_conversions)] // For izip! macro. fn eval_ext_circuit_store, const D: usize>( builder: &mut plonky2::plonk::circuit_builder::CircuitBuilder, lv: &CpuColumnsView>, diff --git a/evm/src/cpu/stack.rs b/evm/src/cpu/stack.rs index 54773b2b..34e36b1e 100644 --- a/evm/src/cpu/stack.rs +++ b/evm/src/cpu/stack.rs @@ -187,7 +187,6 @@ fn eval_packed_one( } } -#[allow(clippy::useless_conversion)] // For izip! macro. pub fn eval_packed( lv: &CpuColumnsView

, yield_constr: &mut ConstraintConsumer

, @@ -302,7 +301,6 @@ fn eval_ext_circuit_one, const D: usize>( } } -#[allow(clippy::useless_conversion)] // For izip! macro. pub fn eval_ext_circuit, const D: usize>( builder: &mut plonky2::plonk::circuit_builder::CircuitBuilder, lv: &CpuColumnsView>, diff --git a/evm/src/recursive_verifier.rs b/evm/src/recursive_verifier.rs index 4d61aec2..477d36c2 100644 --- a/evm/src/recursive_verifier.rs +++ b/evm/src/recursive_verifier.rs @@ -188,7 +188,7 @@ where let circuit = buffer.read_circuit_data(gate_serializer, generator_serializer)?; let target_vec = buffer.read_target_vec()?; let init_challenger_state_target = - >::AlgebraicPermutation::new(target_vec); + >::AlgebraicPermutation::new(target_vec.into_iter()); let zero_target = buffer.read_target()?; let stark_proof_target = StarkProofTarget::from_buffer(buffer)?; let ctl_challenges_target = GrandProductChallengeSet::from_buffer(buffer)?; diff --git a/field/Cargo.toml b/field/Cargo.toml index 0ec85af7..afc084e8 100644 --- a/field/Cargo.toml +++ b/field/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] anyhow = { version = "1.0.40", default-features = false } -itertools = { version = "0.11.0", default-features = false, features = ["use_alloc"] } +itertools = { version = "0.10.0", default-features = false, features = ["use_alloc"] } num = { version = "0.4", default-features = false, features = ["alloc", "rand"] } plonky2_util = { version = "0.1.0", default-features = false } rand = { version = "0.8.5", default-features = false, features = ["getrandom"] } diff --git a/plonky2/Cargo.toml b/plonky2/Cargo.toml index c2e9f970..39b95f21 100644 --- a/plonky2/Cargo.toml +++ b/plonky2/Cargo.toml @@ -21,7 +21,7 @@ timing = ["std"] ahash = { version = "0.7.6", default-features = false, features = ["compile-time-rng"] } # NOTE: Be sure to keep this version the same as the dependency in `hashbrown`. anyhow = { version = "1.0.40", default-features = false } hashbrown = { version = "0.12.3", default-features = false, features = ["ahash", "serde"] } # NOTE: When upgrading, see `ahash` dependency. -itertools = { version = "0.11.0", default-features = false } +itertools = { version = "0.10.0", default-features = false } keccak-hash = { version = "0.8.0", default-features = false } log = { version = "0.4.14", default-features = false } plonky2_maybe_rayon = { version = "0.1.0", default-features = false } diff --git a/plonky2/src/fri/prover.rs b/plonky2/src/fri/prover.rs index a99bd874..75747f62 100644 --- a/plonky2/src/fri/prover.rs +++ b/plonky2/src/fri/prover.rs @@ -136,7 +136,7 @@ fn fri_proof_of_work, C: GenericConfig, c // obtaining our duplex's post-state which contains the PoW response. let mut duplex_intermediate_state = challenger.sponge_state; let witness_input_pos = challenger.input_buffer.len(); - duplex_intermediate_state.set_from_iter(challenger.input_buffer.clone(), 0); + duplex_intermediate_state.set_from_iter(challenger.input_buffer.clone().into_iter(), 0); let pow_witness = (0..=F::NEG_ONE.to_canonical_u64()) .into_par_iter() diff --git a/plonky2/src/gates/selectors.rs b/plonky2/src/gates/selectors.rs index 2376729b..ef2dec81 100644 --- a/plonky2/src/gates/selectors.rs +++ b/plonky2/src/gates/selectors.rs @@ -108,7 +108,6 @@ pub(crate) fn selector_ends_lookups, const D: usize /// k /// else /// UNUSED_SELECTOR -#[allow(clippy::single_range_in_vec_init)] // `groups` is a Vec of Ranges. pub(crate) fn selector_polynomials, const D: usize>( gates: &[GateRef], instances: &[GateInstance], diff --git a/plonky2/src/iop/challenger.rs b/plonky2/src/iop/challenger.rs index f062dc6e..06636d8a 100644 --- a/plonky2/src/iop/challenger.rs +++ b/plonky2/src/iop/challenger.rs @@ -332,8 +332,8 @@ mod tests { // These are mostly arbitrary, but we want to test some rounds with enough inputs/outputs to // trigger multiple absorptions/squeezes. - let num_inputs_per_round = [2, 5, 3]; - let num_outputs_per_round = [1, 2, 4]; + let num_inputs_per_round = vec![2, 5, 3]; + let num_outputs_per_round = vec![1, 2, 4]; // Generate random input messages. let inputs_per_round: Vec> = num_inputs_per_round diff --git a/starky/Cargo.toml b/starky/Cargo.toml index c09ec5af..e47184d7 100644 --- a/starky/Cargo.toml +++ b/starky/Cargo.toml @@ -18,7 +18,7 @@ timing = ["plonky2/timing"] [dependencies] anyhow = { version = "1.0.40", default-features = false } -itertools = { version = "0.11.0", default-features = false } +itertools = { version = "0.10.0", default-features = false } log = { version = "0.4.14", default-features = false } plonky2_maybe_rayon = { version = "0.1.0", default-features = false } plonky2 = { version = "0.1.2", default-features = false }