From cec5bc33a3f2b67bb8e599bce27bafd18fcdba2a Mon Sep 17 00:00:00 2001 From: muursh Date: Mon, 8 Apr 2024 12:39:56 +0500 Subject: [PATCH 1/3] MAX fixes for clippy --- evm_arithmetization/src/arithmetic/modular.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/evm_arithmetization/src/arithmetic/modular.rs b/evm_arithmetization/src/arithmetic/modular.rs index 70761d4be..f91bebe99 100644 --- a/evm_arithmetization/src/arithmetic/modular.rs +++ b/evm_arithmetization/src/arithmetic/modular.rs @@ -307,7 +307,7 @@ pub(crate) fn generate_modular_op( let (lo, hi) = quot_limbs.split_at_mut(N_LIMBS); // Verify that the elements are in the expected range. - debug_assert!(lo.iter().all(|&c| c <= u16::max_value() as i64)); + debug_assert!(lo.iter().all(|&c| c <= u16::MAX as i64)); // Top half of quot_limbs should be zero. debug_assert!(hi.iter().all(|&d| d.is_zero())); @@ -318,7 +318,7 @@ pub(crate) fn generate_modular_op( // it's in the range [0, 2^16 - 1] which will correctly // range-check. for c in lo { - *c += u16::max_value() as i64; + *c += u16::MAX as i64; } // Store the sign of the quotient after the quotient. hi[0] = 1; @@ -522,7 +522,7 @@ pub(crate) fn submod_constr_poly( let sign = hi[0]; // sign must be 1 (negative) or 0 (positive) yield_constr.constraint(filter * sign * (sign - P::ONES)); - let offset = P::Scalar::from_canonical_u16(u16::max_value()); + let offset = P::Scalar::from_canonical_u16(u16::MAX); for c in lo { *c -= offset * sign; } @@ -723,7 +723,7 @@ pub(crate) fn submod_constr_poly_ext_circuit, const let t = builder.mul_extension(filter, t); // sign must be 1 (negative) or 0 (positive) yield_constr.constraint(builder, t); - let offset = F::from_canonical_u16(u16::max_value()); + let offset = F::from_canonical_u16(u16::MAX); for c in lo { let t = builder.mul_const_extension(offset, sign); *c = builder.sub_extension(*c, t); From 9f00846c545399c0275375fde37a453e8b509492 Mon Sep 17 00:00:00 2001 From: muursh Date: Mon, 8 Apr 2024 13:02:47 +0500 Subject: [PATCH 2/3] fix transmut without annotations --- evm_arithmetization/src/fixed_recursive_verifier.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evm_arithmetization/src/fixed_recursive_verifier.rs b/evm_arithmetization/src/fixed_recursive_verifier.rs index a60b9e7e3..2ec8176b6 100644 --- a/evm_arithmetization/src/fixed_recursive_verifier.rs +++ b/evm_arithmetization/src/fixed_recursive_verifier.rs @@ -399,7 +399,7 @@ where *table = MaybeUninit::new(value); } unsafe { - mem::transmute::<_, [RecursiveCircuitsForTable; NUM_TABLES]>(by_table) + mem::transmute::<[std::mem::MaybeUninit>; NUM_TABLES], [RecursiveCircuitsForTable; NUM_TABLES]>(by_table) } } }; From df6327eb537bb3b97207a85f5ac4b1bd170043fa Mon Sep 17 00:00:00 2001 From: muursh Date: Mon, 8 Apr 2024 13:08:31 +0500 Subject: [PATCH 3/3] please the fmt gods --- evm_arithmetization/src/fixed_recursive_verifier.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/evm_arithmetization/src/fixed_recursive_verifier.rs b/evm_arithmetization/src/fixed_recursive_verifier.rs index 2ec8176b6..be65eb413 100644 --- a/evm_arithmetization/src/fixed_recursive_verifier.rs +++ b/evm_arithmetization/src/fixed_recursive_verifier.rs @@ -399,7 +399,10 @@ where *table = MaybeUninit::new(value); } unsafe { - mem::transmute::<[std::mem::MaybeUninit>; NUM_TABLES], [RecursiveCircuitsForTable; NUM_TABLES]>(by_table) + mem::transmute::< + [std::mem::MaybeUninit>; NUM_TABLES], + [RecursiveCircuitsForTable; NUM_TABLES], + >(by_table) } } };