Merge pull request #409 from zcash/beta-lints

Fix various clippy lints from beta toolchain
This commit is contained in:
ebfull 2021-12-02 10:48:49 -07:00 committed by GitHub
commit f89135fd1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 9 additions and 35 deletions

View File

@ -24,6 +24,7 @@ and this project adheres to Rust's notion of
### Removed
- `halo2::arithmetic::BatchInvert` (use `ff::BatchInvert` instead).
- `impl Default for halo2::poly::Rotation` (use `Rotation::cur()` instead).
## [0.1.0-beta.1] - 2021-09-24
Initial beta release!

View File

@ -65,9 +65,6 @@ struct FieldConfig {
// This is important when building larger circuits, where columns are used by
// multiple sets of instructions.
s_mul: Selector,
/// The fixed column used to load constants.
constant: Column<Fixed>,
}
impl<F: FieldExt> FieldChip<F> {
@ -125,7 +122,6 @@ impl<F: FieldExt> FieldChip<F> {
advice,
instance,
s_mul,
constant,
}
}
}

View File

@ -112,6 +112,7 @@ impl<C: CurveAffine> VerifyingKey<C> {
/// Minimal representation of a verification key that can be used to identify
/// its active contents.
#[allow(dead_code)]
#[derive(Debug)]
pub struct PinnedVerificationKey<'a, C: CurveAffine> {
base_modulus: &'static str,

View File

@ -982,6 +982,7 @@ pub struct ConstraintSystem<F: Field> {
}
/// Represents the minimal parameters that determine a `ConstraintSystem`.
#[allow(dead_code)]
#[derive(Debug)]
pub struct PinnedConstraintSystem<'a, F: Field> {
num_fixed_columns: &'a usize,

View File

@ -30,14 +30,12 @@ pub(in crate::plonk) struct Permuted<C: CurveAffine> {
permuted_input_poly: Polynomial<C::Scalar, Coeff>,
permuted_input_coset: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
permuted_input_blind: Blind<C::Scalar>,
permuted_input_commitment: C,
unpermuted_table_expressions: Vec<Polynomial<C::Scalar, LagrangeCoeff>>,
unpermuted_table_cosets: Vec<Polynomial<C::Scalar, ExtendedLagrangeCoeff>>,
permuted_table_expression: Polynomial<C::Scalar, LagrangeCoeff>,
permuted_table_poly: Polynomial<C::Scalar, Coeff>,
permuted_table_coset: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
permuted_table_blind: Blind<C::Scalar>,
permuted_table_commitment: C,
}
#[derive(Debug)]
@ -46,7 +44,6 @@ pub(in crate::plonk) struct Committed<C: CurveAffine> {
product_poly: Polynomial<C::Scalar, Coeff>,
product_coset: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
product_blind: Blind<C::Scalar>,
product_commitment: C,
}
pub(in crate::plonk) struct Constructed<C: CurveAffine> {
@ -225,14 +222,12 @@ impl<F: FieldExt> Argument<F> {
permuted_input_poly,
permuted_input_coset,
permuted_input_blind,
permuted_input_commitment,
unpermuted_table_expressions,
unpermuted_table_cosets,
permuted_table_expression,
permuted_table_poly,
permuted_table_coset,
permuted_table_blind,
permuted_table_commitment,
})
}
}
@ -393,7 +388,6 @@ impl<C: CurveAffine> Permuted<C> {
permuted: self,
product_poly: z,
product_coset,
product_commitment,
product_blind,
})
}

View File

@ -288,12 +288,6 @@ impl<'a, F: Field, B: Basis> Mul<F> for Polynomial<F, B> {
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Rotation(pub i32);
impl Default for Rotation {
fn default() -> Rotation {
Rotation(0)
}
}
impl Rotation {
/// The current location in the evaluation domain
pub fn cur() -> Rotation {

View File

@ -143,9 +143,9 @@ pub fn create_proof<C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptWrite<C
fn parallel_generator_collapse<C: CurveAffine>(g: &mut [C], challenge: C::Scalar) {
let len = g.len() / 2;
let (mut g_lo, g_hi) = g.split_at_mut(len);
let (g_lo, g_hi) = g.split_at_mut(len);
parallelize(&mut g_lo, |g_lo, start| {
parallelize(g_lo, |g_lo, start| {
let g_hi = &g_hi[start..];
let mut tmp = Vec::with_capacity(g_lo.len());
for (g_lo, g_hi) in g_lo.iter().zip(g_hi.iter()) {

View File

@ -409,13 +409,13 @@ impl<G: Group> EvaluationDomain<G> {
///
/// `into_coset` should be set to `true` when moving into the coset,
/// and `false` when moving out. This toggles the choice of `zeta`.
fn distribute_powers_zeta(&self, mut a: &mut [G], into_coset: bool) {
fn distribute_powers_zeta(&self, a: &mut [G], into_coset: bool) {
let coset_powers = if into_coset {
[self.g_coset, self.g_coset_inv]
} else {
[self.g_coset_inv, self.g_coset]
};
parallelize(&mut a, |a, mut index| {
parallelize(a, |a, mut index| {
for a in a {
// Distribute powers to move into/from coset
let i = index % (coset_powers.len() + 1);
@ -544,6 +544,7 @@ impl<G: Group> EvaluationDomain<G> {
}
/// Represents the minimal parameters that determine an `EvaluationDomain`.
#[allow(dead_code)]
#[derive(Debug)]
pub struct PinnedEvaluationDomain<'a, G: Group> {
k: &'a u32,

View File

@ -15,14 +15,6 @@ use group::Curve;
use std::io;
use std::marker::PhantomData;
#[derive(Debug, Clone)]
struct CommitmentData<C: CurveAffine> {
set_index: usize,
blind: Blind<C::Scalar>,
point_indices: Vec<usize>,
evals: Vec<C::Scalar>,
}
/// Create a multi-opening proof
pub fn create_proof<'a, I, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
params: &Params<C>,

View File

@ -10,12 +10,6 @@ use super::{
};
use crate::arithmetic::{eval_polynomial, lagrange_interpolate, CurveAffine, FieldExt};
use crate::transcript::{EncodedChallenge, TranscriptRead};
#[derive(Debug, Clone)]
struct CommitmentData<C: CurveAffine> {
set_index: usize,
point_indices: Vec<usize>,
evals: Vec<C::Scalar>,
}
/// Verify a multi-opening proof
pub fn verify_proof<

View File

@ -218,7 +218,7 @@ fn plonk_api() {
layouter.assign_region(
|| "public_input",
|mut region| {
let value = region.assign_advice(|| "value", self.config.a, 0, || f())?;
let value = region.assign_advice(|| "value", self.config.a, 0, &mut f)?;
region.assign_fixed(|| "public", self.config.sp, 0, || Ok(FF::one()))?;
Ok(value.cell())