Skip to content
GitHub Actions / Clippy (1.56.1) failed Jan 4, 2024 in 0s

Clippy (1.56.1)

40 errors

Details

Results

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

Versions

  • rustc 1.75.0 (82e1608df 2023-12-21)
  • cargo 1.75.0 (1d8b05cdd 2023-11-20)
  • clippy 0.1.75 (82e1608 2023-12-21)

Annotations

Check failure on line 153 in halo2_proofs/src/helpers.rs

See this annotation in the file changed.

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

accessing first element with `slice.get(0)`

error: accessing first element with `slice.get(0)`
   --> halo2_proofs/src/helpers.rs:153:40
    |
153 |     4 + slice.len() * (4 + field_len * slice.get(0).map(|poly| poly.len()).unwrap_or(0))
    |                                        ^^^^^^^^^^^^ help: try: `slice.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

Check failure on line 273 in halo2_proofs/src/plonk.rs

See this annotation in the file changed.

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

accessing first element with `self .selectors.get(0)`

error: accessing first element with `self
                           .selectors.get(0)`
   --> halo2_proofs/src/plonk.rs:271:20
    |
271 |                   * (self
    |  ____________________^
272 | |                     .selectors
273 | |                     .get(0)
    | |___________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
    = note: `-D clippy::get-first` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::get_first)]`
help: try
    |
271 ~                 * (self
272 +                     .selectors.first()
    |

Check failure on line 455 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

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

error: this expression creates a reference which is immediately dereferenced by the compiler
   --> halo2_proofs/src/plonk/prover.rs:455:29
    |
455 | ...                   &domain,
    |                       ^^^^^^^ help: change this to: `domain`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-D clippy::needless-borrow` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`

Check failure on line 434 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

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

error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
   --> halo2_proofs/src/plonk/prover.rs:434:22
    |
434 |         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 failure on line 433 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

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

error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
   --> halo2_proofs/src/plonk/prover.rs:433:24
    |
433 |         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: `-D clippy::mem-replace-with-default` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::mem_replace_with_default)]`

Check failure on line 337 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

this `if` has identical blocks

error: this `if` has identical blocks
   --> halo2_proofs/src/plonk/prover.rs:334:55
    |
334 |               if column_indices.contains(&column_index) {
    |  _______________________________________________________^
335 | |                 // TODO: Check that column_index in witness is Some
336 | |                 // TODO: Check that the column length is `params.n()`
337 | |             } else {
    | |_____________^
    |
note: same as this
   --> halo2_proofs/src/plonk/prover.rs:337:20
    |
337 |               } else {
    |  ____________________^
338 | |                 // TODO: Check that column_index in witness is None
339 | |             };
    | |_____________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
    = note: `#[deny(clippy::if_same_then_else)]` on by default

Check failure on line 329 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

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

error: unnecessary `if let` since only the `Some` variant of the iterator element is used
   --> halo2_proofs/src/plonk/prover.rs:319:13
    |
319 |               for witness_column in witness_circuit {
    |               ^                     --------------- help: try: `witness_circuit.iter().flatten()`
    |  _____________|
    | |
320 | |                 if let Some(witness_column) = witness_column {
321 | |                     if witness_column.len() != self.params.n() as usize {
322 | |                         return Err(Error::Other(format!(
...   |
328 | |                 }
329 | |             }
    | |_____________^
    |
help: ...and remove the `if let` statement in the for loop
   --> halo2_proofs/src/plonk/prover.rs:320:17
    |
320 | /                 if let Some(witness_column) = witness_column {
321 | |                     if witness_column.len() != self.params.n() as usize {
322 | |                         return Err(Error::Other(format!(
323 | |                             "unexpected length in witness_column.  Got {}, expected {}",
...   |
327 | |                     }
328 | |                 }
    | |_________________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
    = note: `-D clippy::manual-flatten` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::manual_flatten)]`

Check failure on line 309 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

useless use of `format!`

error: useless use of `format!`
   --> halo2_proofs/src/plonk/prover.rs:309:37
    |
309 |             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: `-D clippy::useless-format` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::useless_format)]`

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

See this annotation in the file changed.

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

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

error: very complex type used. Consider factoring parts into `type` definitions
   --> halo2_proofs/src/plonk/prover.rs:268:18
    |
268 |         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 failure on line 2294 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

redundant closure

error: redundant closure
    --> halo2_proofs/src/plonk/circuit.rs:2294:22
     |
2294 |                 .map(|p| sealed::Phase(p))
     |                      ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `sealed::Phase`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

Check failure on line 2289 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

redundant closure

error: redundant closure
    --> halo2_proofs/src/plonk/circuit.rs:2289:22
     |
2289 |                 .map(|p| sealed::Phase(p))
     |                      ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `sealed::Phase`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
     = note: `-D clippy::redundant-closure` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::redundant_closure)]`

Check failure on line 2133 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

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

error: very complex type used. Consider factoring parts into `type` definitions
    --> halo2_proofs/src/plonk/circuit.rs:2128:10
     |
2128 |       ) -> (
     |  __________^
2129 | |         Queries,
2130 | |         Vec<Gate<F>>,
2131 | |         Vec<lookup::Argument<F>>,
2132 | |         Vec<shuffle::Argument<F>>,
2133 | |     ) {
     | |_____^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check failure on line 2025 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

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

error: casting to the same type is unnecessary (`usize` -> `usize`)
    --> halo2_proofs/src/plonk/circuit.rs:2025:25
     |
2025 |         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 failure on line 2024 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

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

error: casting to the same type is unnecessary (`usize` -> `usize`)
    --> halo2_proofs/src/plonk/circuit.rs:2024:37
     |
2024 |         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: `-D clippy::unnecessary-cast` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::unnecessary_cast)]`

Check failure on line 2007 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

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

error: very complex type used. Consider factoring parts into `type` definitions
    --> halo2_proofs/src/plonk/circuit.rs:2000:6
     |
2000 |   ) -> Result<
     |  ______^
2001 | |     (
2002 | |         CompiledCircuitV2<F>,
2003 | |         ConcreteCircuit::Config,
...    |
2006 | |     Error,
2007 | | > {
     | |_^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check failure on line 1928 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

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

error: very complex type used. Consider factoring parts into `type` definitions
    --> halo2_proofs/src/plonk/circuit.rs:1928:10
     |
1928 |     ) -> 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: `-D clippy::type-complexity` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::type_complexity)]`

Check failure on line 1738 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference

error: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference
    --> halo2_proofs/src/plonk/circuit.rs:1738:32
     |
1738 |     fn to_expression<F: Field>(&mut self, expr: &ExpressionMid<F>) -> Expression<F> {
     |                                ^^^^^^^^^
     |
     = help: consider choosing a less ambiguous name
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
     = note: `-D clippy::wrong-self-convention` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::wrong_self_convention)]`

Check failure on line 892 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true

error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> halo2_proofs/src/plonk/circuit.rs:892:1
    |
892 | impl<F> Into<ExpressionMid<F>> for Expression<F> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: `-D clippy::from-over-into` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::from_over_into)]`
help: replace the `Into` implementation with `From<plonk::circuit::Expression<F>>`
    |
892 ~ impl<F> From<Expression<F>> for ExpressionMid<F> {
893 ~     fn from(val: Expression<F>) -> Self {
894 ~         match val {
    |

Check failure on line 153 in halo2_proofs/src/helpers.rs

See this annotation in the file changed.

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

accessing first element with `slice.get(0)`

error: accessing first element with `slice.get(0)`
   --> halo2_proofs/src/helpers.rs:153:40
    |
153 |     4 + slice.len() * (4 + field_len * slice.get(0).map(|poly| poly.len()).unwrap_or(0))
    |                                        ^^^^^^^^^^^^ help: try: `slice.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

Check failure on line 273 in halo2_proofs/src/plonk.rs

See this annotation in the file changed.

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

accessing first element with `self .selectors.get(0)`

error: accessing first element with `self
                           .selectors.get(0)`
   --> halo2_proofs/src/plonk.rs:271:20
    |
271 |                   * (self
    |  ____________________^
272 | |                     .selectors
273 | |                     .get(0)
    | |___________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
    = note: `-D clippy::get-first` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::get_first)]`
help: try
    |
271 ~                 * (self
272 +                     .selectors.first()
    |

Check failure on line 333 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

unused variable: `advice_column`

error: unused variable: `advice_column`
   --> halo2_proofs/src/plonk/prover.rs:333:28
    |
333 |         for (column_index, advice_column) in witness.iter().enumerate() {
    |                            ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_advice_column`
    |
    = note: `-D unused-variables` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(unused_variables)]`

Check failure on line 455 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

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

error: this expression creates a reference which is immediately dereferenced by the compiler
   --> halo2_proofs/src/plonk/prover.rs:455:29
    |
455 | ...                   &domain,
    |                       ^^^^^^^ help: change this to: `domain`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-D clippy::needless-borrow` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`

Check failure on line 434 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

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

error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
   --> halo2_proofs/src/plonk/prover.rs:434:22
    |
434 |         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 failure on line 433 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

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

error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
   --> halo2_proofs/src/plonk/prover.rs:433:24
    |
433 |         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: `-D clippy::mem-replace-with-default` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::mem_replace_with_default)]`

Check failure on line 337 in halo2_proofs/src/plonk/prover.rs

See this annotation in the file changed.

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

this `if` has identical blocks

error: this `if` has identical blocks
   --> halo2_proofs/src/plonk/prover.rs:334:55
    |
334 |               if column_indices.contains(&column_index) {
    |  _______________________________________________________^
335 | |                 // TODO: Check that column_index in witness is Some
336 | |                 // TODO: Check that the column length is `params.n()`
337 | |             } else {
    | |_____________^
    |
note: same as this
   --> halo2_proofs/src/plonk/prover.rs:337:20
    |
337 |               } else {
    |  ____________________^
338 | |                 // TODO: Check that column_index in witness is None
339 | |             };
    | |_____________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
    = note: `#[deny(clippy::if_same_then_else)]` on by default