Skip to content

WIP

WIP #263

GitHub Actions / Clippy (beta) succeeded Jan 2, 2024 in 1s

Clippy (beta)

89 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 89
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 390 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:390:29
    |
390 | ...                   &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 369 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:369:22
    |
369 |         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 368 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:368:24
    |
368 |         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 271 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:268:55
    |
268 |               if column_indices.contains(&column_index) {
    |  _______________________________________________________^
269 | |                 // TODO: Check that column_index in witness is Some
270 | |                 // TODO: Check that the column length is `params.n()`
271 | |             } else {
    | |_____________^
    |
note: same as this
   --> halo2_proofs/src/plonk/prover.rs:271:20
    |
271 |               } else {
    |  ____________________^
272 | |                 // TODO: Check that column_index in witness is None
273 | |             };
    | |_____________^
    = 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 263 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:253:13
    |
253 |               for witness_column in witness_circuit {
    |               ^                     --------------- help: try: `witness_circuit.iter().flatten()`
    |  _____________|
    | |
254 | |                 if let Some(witness_column) = witness_column {
255 | |                     if witness_column.len() != self.params.n() as usize {
256 | |                         return Err(Error::Other(format!(
...   |
262 | |                 }
263 | |             }
    | |_____________^
    |
help: ...and remove the `if let` statement in the for loop
   --> halo2_proofs/src/plonk/prover.rs:254:17
    |
254 | /                 if let Some(witness_column) = witness_column {
255 | |                     if witness_column.len() != self.params.n() as usize {
256 | |                         return Err(Error::Other(format!(
257 | |                             "unexpected length in witness_column.  Got {}, expected {}",
...   |
261 | |                     }
262 | |                 }
    | |_________________^
    = 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 243 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:243:37
    |
243 |             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 203 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:203:18
    |
203 |         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 2197 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

returning the result of a `let` binding from a block

warning: returning the result of a `let` binding from a block
    --> halo2_proofs/src/plonk/circuit.rs:2197:9
     |
2190 | /         let queries = Queries {
2191 | |             advice: queries.advice.into_iter().collect(),
2192 | |             instance: queries.instance.into_iter().collect(),
2193 | |             fixed: queries.fixed.into_iter().collect(),
2194 | |             num_advice_queries,
2195 | |         };
     | |__________- unnecessary `let` binding
2196 |           // println!("DBG collected queries\n{:#?}", queries);
2197 |           queries
     |           ^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
     = note: `-W clippy::let-and-return` implied by `-W clippy::all`
help: return the expression directly
     |
2190 ~         
2191 |         // println!("DBG collected queries\n{:#?}", queries);
2192 ~         Queries {
2193 +             advice: queries.advice.into_iter().collect(),
2194 +             instance: queries.instance.into_iter().collect(),
2195 +             fixed: queries.fixed.into_iter().collect(),
2196 +             num_advice_queries,
2197 +         }
     |

Check warning on line 1984 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:1984:25
     |
1984 |         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 1983 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:1983:37
     |
1983 |         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 1966 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:1959:6
     |
1959 |   ) -> Result<
     |  ______^
1960 | |     (
1961 | |         CompiledCircuitV2<F>,
1962 | |         ConcreteCircuit::Config,
...    |
1965 | |     Error,
1966 | | > {
     | |_^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 1887 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:1887:10
     |
1887 |     ) -> 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 892 in halo2_proofs/src/plonk/circuit.rs

See this annotation in the file changed.

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

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

warning: 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: replace the `Into` implentation with `From<plonk::circuit::Expression<F>>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: `-W clippy::from-over-into` implied by `-W clippy::all`

Check warning on line 10 in halo2_proofs/src/plonk/shuffle.rs

See this annotation in the file changed.

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

fields `name`, `input_expressions` and `shuffle_expressions` are never read

warning: fields `name`, `input_expressions` and `shuffle_expressions` are never read
  --> halo2_proofs/src/plonk/shuffle.rs:10:16
   |
9  | pub struct ArgumentV2<F: Field> {
   |            ---------- fields in this struct
10 |     pub(crate) name: String,
   |                ^^^^
11 |     pub(crate) input_expressions: Vec<ExpressionMid<F>>,
   |                ^^^^^^^^^^^^^^^^^
12 |     pub(crate) shuffle_expressions: Vec<ExpressionMid<F>>,
   |                ^^^^^^^^^^^^^^^^^^^
   |
   = note: `ArgumentV2` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis

Check warning on line 10 in halo2_proofs/src/plonk/lookup.rs

See this annotation in the file changed.

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

fields `name`, `input_expressions` and `table_expressions` are never read

warning: fields `name`, `input_expressions` and `table_expressions` are never read
  --> halo2_proofs/src/plonk/lookup.rs:10:16
   |
9  | pub struct ArgumentV2<F: Field> {
   |            ---------- fields in this struct
10 |     pub(crate) name: String,
   |                ^^^^
11 |     pub(crate) input_expressions: Vec<ExpressionMid<F>>,
   |                ^^^^^^^^^^^^^^^^^
12 |     pub(crate) table_expressions: Vec<ExpressionMid<F>>,
   |                ^^^^^^^^^^^^^^^^^
   |
   = note: `ArgumentV2` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis

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

See this annotation in the file changed.

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

associated function `collect_queries` is never used

warning: associated function `collect_queries` is never used
    --> halo2_proofs/src/plonk/circuit.rs:2141:19
     |
2141 |     pub(crate) fn collect_queries(&self) -> Queries {
     |                   ^^^^^^^^^^^^^^^

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

See this annotation in the file changed.

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

associated function `phases` is never used

warning: associated function `phases` is never used
    --> halo2_proofs/src/plonk/circuit.rs:2131:19
     |
2131 |     pub(crate) fn phases(&self) -> Vec<u8> {
     |                   ^^^^^^

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

See this annotation in the file changed.

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

multiple fields are never read

warning: multiple fields are never read
    --> halo2_proofs/src/plonk/circuit.rs:1803:16
     |
1802 | pub struct ConstraintSystemV2Backend<F: Field> {
     |            ------------------------- fields in this struct
1803 |     pub(crate) num_fixed_columns: usize,
     |                ^^^^^^^^^^^^^^^^^
1804 |     pub(crate) num_advice_columns: usize,
     |                ^^^^^^^^^^^^^^^^^^
1805 |     pub(crate) num_instance_columns: usize,
     |                ^^^^^^^^^^^^^^^^^^^^
1806 |     // pub(crate) num_selectors: usize,
1807 |     pub(crate) num_challenges: usize,
     |                ^^^^^^^^^^^^^^
...
1810 |     pub(crate) unblinded_advice_columns: Vec<usize>,
     |                ^^^^^^^^^^^^^^^^^^^^^^^^
...
1813 |     pub(crate) advice_column_phase: Vec<u8>,
     |                ^^^^^^^^^^^^^^^^^^^
1814 |     /// Contains the phase for each challenge. Should have same length as num_challenges.
1815 |     pub(crate) challenge_phase: Vec<u8>,
     |                ^^^^^^^^^^^^^^^
...
1821 |     pub(crate) gates: Vec<GateV2Backend<F>>,
     |                ^^^^^
...
1831 |     pub(crate) lookups: Vec<lookup::ArgumentV2<F>>,
     |                ^^^^^^^
...
1835 |     pub(crate) shuffles: Vec<shuffle::ArgumentV2<F>>,
     |                ^^^^^^^^
...
1838 |     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

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

See this annotation in the file changed.

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

function `collect_queries` is never used

warning: function `collect_queries` is never used
    --> halo2_proofs/src/plonk/circuit.rs:1713:4
     |
1713 | fn collect_queries<F: Field>(expr: &ExpressionMid<F>, queries: &mut QueriesSet) {
     |    ^^^^^^^^^^^^^^^

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

See this annotation in the file changed.

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

struct `QueriesSet` is never constructed

warning: struct `QueriesSet` is never constructed
    --> halo2_proofs/src/plonk/circuit.rs:1707:8
     |
1707 | struct QueriesSet {
     |        ^^^^^^^^^^

Check warning on line 133 in halo2_proofs/src/plonk.rs

See this annotation in the file changed.

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

associated function `get_any_query_index` is never used

warning: associated function `get_any_query_index` is never used
   --> halo2_proofs/src/plonk.rs:133:19
    |
133 |     pub(crate) fn get_any_query_index(&self, column: Column<Any>, at: Rotation) -> usize {
    |                   ^^^^^^^^^^^^^^^^^^^

Check warning on line 123 in halo2_proofs/src/plonk.rs

See this annotation in the file changed.

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

associated function `get_instance_query_index` is never used

warning: associated function `get_instance_query_index` is never used
   --> halo2_proofs/src/plonk.rs:123:19
    |
123 |     pub(crate) fn get_instance_query_index(&self, column: Column<Instance>, at: Rotation) -> usize {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 113 in halo2_proofs/src/plonk.rs

See this annotation in the file changed.

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

associated function `get_fixed_query_index` is never used

warning: associated function `get_fixed_query_index` is never used
   --> halo2_proofs/src/plonk.rs:113:19
    |
113 |     pub(crate) fn get_fixed_query_index(&self, column: Column<Fixed>, at: Rotation) -> usize {
    |                   ^^^^^^^^^^^^^^^^^^^^^

Check warning on line 103 in halo2_proofs/src/plonk.rs

See this annotation in the file changed.

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

associated function `get_advice_query_index` is never used

warning: associated function `get_advice_query_index` is never used
   --> halo2_proofs/src/plonk.rs:103:19
    |
103 |     pub(crate) fn get_advice_query_index(&self, column: Column<Advice>, at: Rotation) -> usize {
    |                   ^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

Check warning on line 408 in halo2_proofs/src/plonk.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/src/plonk.rs:408:13
    |
408 |         let mut vk = Self {
    |             ----^^
    |             |
    |             help: remove this `mut`