Skip to content
GitHub Actions / Clippy (beta) succeeded Dec 29, 2023 in 1s

Clippy (beta)

45 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 45
Note 0
Help 0

Versions

  • rustc 1.66.0 (69f9c33d7 2022-12-12)
  • cargo 1.66.0 (d65d197ad 2022-11-15)
  • clippy 0.1.66 (69f9c33 2022-12-12)

Annotations

Check warning on line 387 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> halo2_proofs/src/plonk/prover.rs:387:29
    |
387 | ...                   &domain,
    |                       ^^^^^^^ help: change this to: `domain`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-W clippy::needless-borrow` implied by `-W clippy::all`

Check warning on line 366 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`

warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
   --> halo2_proofs/src/plonk/prover.rs:366:22
    |
366 |         let advice = std::mem::replace(&mut self.advice, Vec::new());
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut self.advice)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default

Check warning on line 365 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`

warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
   --> halo2_proofs/src/plonk/prover.rs:365:24
    |
365 |         let instance = std::mem::replace(&mut self.instance, Vec::new());
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut self.instance)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default
    = note: `-W clippy::mem-replace-with-default` implied by `-W clippy::all`

Check warning on line 268 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

this `if` has identical blocks

warning: this `if` has identical blocks
   --> halo2_proofs/src/plonk/prover.rs:265:55
    |
265 |               if column_indices.contains(&column_index) {
    |  _______________________________________________________^
266 | |                 // TODO: Check that column_index in witness is Some
267 | |                 // TODO: Check that the column length is `params.n()`
268 | |             } else {
    | |_____________^
    |
note: same as this
   --> halo2_proofs/src/plonk/prover.rs:268:20
    |
268 |               } else {
    |  ____________________^
269 | |                 // TODO: Check that column_index in witness is None
270 | |             };
    | |_____________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
    = note: `-W clippy::if-same-then-else` implied by `-W clippy::all`

Check warning on line 260 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

unnecessary `if let` since only the `Some` variant of the iterator element is used

warning: unnecessary `if let` since only the `Some` variant of the iterator element is used
   --> halo2_proofs/src/plonk/prover.rs:250:13
    |
250 |               for witness_column in witness_circuit {
    |               ^                     --------------- help: try: `witness_circuit.iter().flatten()`
    |  _____________|
    | |
251 | |                 if let Some(witness_column) = witness_column {
252 | |                     if witness_column.len() != self.params.n() as usize {
253 | |                         return Err(Error::Other(format!(
...   |
259 | |                 }
260 | |             }
    | |_____________^
    |
help: ...and remove the `if let` statement in the for loop
   --> halo2_proofs/src/plonk/prover.rs:251:17
    |
251 | /                 if let Some(witness_column) = witness_column {
252 | |                     if witness_column.len() != self.params.n() as usize {
253 | |                         return Err(Error::Other(format!(
254 | |                             "unexpected length in witness_column.  Got {}, expected {}",
...   |
258 | |                     }
259 | |                 }
    | |_________________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
    = note: `-W clippy::manual-flatten` implied by `-W clippy::all`

Check warning on line 240 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

useless use of `format!`

warning: useless use of `format!`
   --> halo2_proofs/src/plonk/prover.rs:240:37
    |
240 |             return Err(Error::Other(format!("witness.len() != advice.len()")));
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"witness.len() != advice.len()".to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
    = note: `-W clippy::useless-format` implied by `-W clippy::all`

Check warning on line 200 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
   --> halo2_proofs/src/plonk/prover.rs:200:18
    |
200 |         witness: Vec<Vec<Option<Polynomial<Assigned<Scheme::Scalar>, LagrangeCoeff>>>>,
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 1820 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

casting to the same type is unnecessary (`usize` -> `usize`)

warning: casting to the same type is unnecessary (`usize` -> `usize`)
    --> halo2_proofs/src/plonk/circuit.rs:1820:25
     |
1820 |         usable_rows: 0..n as usize - (cs.blinding_factors() + 1),
     |                         ^^^^^^^^^^ help: try: `n`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Check warning on line 1819 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

casting to the same type is unnecessary (`usize` -> `usize`)

warning: casting to the same type is unnecessary (`usize` -> `usize`)
    --> halo2_proofs/src/plonk/circuit.rs:1819:37
     |
1819 |         selectors: vec![vec![false; n as usize]; cs.num_selectors],
     |                                     ^^^^^^^^^^ help: try: `n`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
     = note: `-W clippy::unnecessary-cast` implied by `-W clippy::all`

Check warning on line 1802 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
    --> halo2_proofs/src/plonk/circuit.rs:1795:6
     |
1795 |   ) -> Result<
     |  ______^
1796 | |     (
1797 | |         CompiledCircuitV2<F>,
1798 | |         ConcreteCircuit::Config,
...    |
1801 | |     Error,
1802 | | > {
     | |_^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 1723 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
    --> halo2_proofs/src/plonk/circuit.rs:1723:10
     |
1723 |     ) -> Result<Vec<Option<Polynomial<Assigned<F>, LagrangeCoeff>>>, Error> {
     |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
     = note: `-W clippy::type-complexity` implied by `-W clippy::all`

Check warning on line 1639 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

fields `num_fixed_columns` and `general_column_annotations` are never read

warning: fields `num_fixed_columns` and `general_column_annotations` are never read
    --> halo2_proofs/src/plonk/circuit.rs:1639:16
     |
1638 | pub struct ConstraintSystemV2Backend<F: Field> {
     |            ------------------------- fields in this struct
1639 |     pub(crate) num_fixed_columns: usize,
     |                ^^^^^^^^^^^^^^^^^
...
1674 |     pub(crate) general_column_annotations: HashMap<metadata::Column, String>,
     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `ConstraintSystemV2Backend` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
     = note: `#[warn(dead_code)]` on by default

Check warning on line 264 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

unused variable: `advice_column`

warning: unused variable: `advice_column`
   --> halo2_proofs/src/plonk/prover.rs:264:28
    |
264 |         for (column_index, advice_column) in witness.iter().enumerate() {
    |                            ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_advice_column`
    |
    = note: `#[warn(unused_variables)]` on by default

Check warning on line 235 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> halo2_proofs/tests/frontend_backend_split.rs:235:17
    |
235 |                 config.s_instance.enable(&mut region, offset);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
    = note: `#[warn(unused_must_use)]` on by default

Check warning on line 524 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> halo2_proofs/tests/frontend_backend_split.rs:524:40
    |
524 |     let strategy = SingleStrategy::new(&verifier_params);
    |                                        ^^^^^^^^^^^^^^^^ help: change this to: `verifier_params`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 469 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> halo2_proofs/tests/frontend_backend_split.rs:469:40
    |
469 |     let strategy = SingleStrategy::new(&verifier_params);
    |                                        ^^^^^^^^^^^^^^^^ help: change this to: `verifier_params`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-W clippy::needless-borrow` implied by `-W clippy::all`

Check warning on line 458 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

redundant clone

warning: redundant clone
   --> halo2_proofs/tests/frontend_backend_split.rs:458:18
    |
458 |         &[circuit.clone()],
    |                  ^^^^^^^^ help: remove this
    |
note: this value is dropped without further use
   --> halo2_proofs/tests/frontend_backend_split.rs:458:11
    |
458 |         &[circuit.clone()],
    |           ^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
    = note: `-W clippy::redundant-clone` implied by `-W clippy::all`

Check warning on line 65 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
  --> halo2_proofs/tests/frontend_backend_split.rs:65:10
   |
65 |     ) -> Result<(AssignedCell<F, F>, [AssignedCell<F, F>; 4]), Error> {
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
   = note: `-W clippy::type-complexity` implied by `-W clippy::all`

Check warning on line 518 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

variable does not need to be mutable

warning: variable does not need to be mutable
   --> halo2_proofs/tests/frontend_backend_split.rs:518:9
    |
518 |     let mut transcript = prover.create_proof().unwrap();
    |         ----^^^^^^^^^^
    |         |
    |         help: remove this `mut`

Check warning on line 504 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

variable does not need to be mutable

warning: variable does not need to be mutable
   --> halo2_proofs/tests/frontend_backend_split.rs:504:9
    |
504 |     let mut transcript = Blake2bWrite::<_, G1Affine, Challenge255<_>>::init(vec![]);
    |         ----^^^^^^^^^^
    |         |
    |         help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

Check warning on line 19 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

unused import: `EncodedChallenge`

warning: unused import: `EncodedChallenge`
  --> halo2_proofs/tests/frontend_backend_split.rs:19:46
   |
19 |     Blake2bRead, Blake2bWrite, Challenge255, EncodedChallenge, TranscriptReadBuffer,
   |                                              ^^^^^^^^^^^^^^^^

Check warning on line 17 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

unused import: `halo2_proofs::poly::VerificationStrategy`

warning: unused import: `halo2_proofs::poly::VerificationStrategy`
  --> halo2_proofs/tests/frontend_backend_split.rs:17:5
   |
17 | use halo2_proofs::poly::VerificationStrategy;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 15 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

unused import: `Verifier`

warning: unused import: `Verifier`
  --> halo2_proofs/tests/frontend_backend_split.rs:15:78
   |
15 | use halo2_proofs::poly::commitment::{CommitmentScheme, ParamsProver, Prover, Verifier};
   |                                                                              ^^^^^^^^

Check warning on line 15 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

unused import: `Prover`

warning: unused import: `Prover`
  --> halo2_proofs/tests/frontend_backend_split.rs:15:70
   |
15 | use halo2_proofs::poly::commitment::{CommitmentScheme, ParamsProver, Prover, Verifier};
   |                                                                      ^^^^^^

Check warning on line 403 in halo2_proofs/tests/frontend_backend_split.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

unused import: `ParamsVerifierKZG`

warning: unused import: `ParamsVerifierKZG`
   --> halo2_proofs/tests/frontend_backend_split.rs:403:75
    |
403 | use halo2_proofs::poly::kzg::commitment::{KZGCommitmentScheme, ParamsKZG, ParamsVerifierKZG};
    |                                                                           ^^^^^^^^^^^^^^^^^