Skip to content

Merge pull request #835 from zcash/halo2_poseidon-0.1.0 #157

Merge pull request #835 from zcash/halo2_poseidon-0.1.0

Merge pull request #835 from zcash/halo2_poseidon-0.1.0 #157

GitHub Actions / Clippy (beta) failed Dec 16, 2024 in 2s

Clippy (beta)

2 errors, 159 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 2
Warning 159
Note 0
Help 0

Versions

  • rustc 1.84.0-beta.4 (202008a1b 2024-12-07)
  • cargo 1.84.0-beta.4 (66221abde 2024-11-19)
  • clippy 0.1.84 (202008a1b8 2024-12-07)

Annotations

Check failure on line 158 in halo2_gadgets/src/utilities/lookup_range_check.rs

See this annotation in the file changed.

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

missing documentation for a method

error: missing documentation for a method
   --> halo2_gadgets/src/utilities/lookup_range_check.rs:158:5
    |
158 |     pub fn load(&self, layouter: &mut impl Layouter<F>) -> Result<(), Error> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check failure on line 174 in halo2_gadgets/src/sinsemilla/merkle.rs

See this annotation in the file changed.

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

missing documentation for a module

error: missing documentation for a module
   --> halo2_gadgets/src/sinsemilla/merkle.rs:174:1
    |
174 | pub mod tests {
    | ^^^^^^^^^^^^^
    |
note: the lint level is defined here
   --> halo2_gadgets/src/lib.rs:21:9
    |
21  | #![deny(missing_docs)]
    |         ^^^^^^^^^^^^

Check warning on line 407 in halo2_gadgets/src/utilities.rs

See this annotation in the file changed.

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

an array of `Range` that is only one element

warning: an array of `Range` that is only one element
   --> halo2_gadgets/src/utilities.rs:407:47
    |
407 |         decompose(pallas::Base::random(rng), &[0..255]);
    |                                               ^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init
    = note: `-W clippy::single-range-in-vec-init` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::single_range_in_vec_init)]`
help: if you wanted a `Vec` that contains the entire range, try
    |
407 |         decompose(pallas::Base::random(rng), &(0..255).collect::<std::vec::Vec<usize>>());
    |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: if you wanted an array of len 255, try
    |
407 |         decompose(pallas::Base::random(rng), &[0; 255]);
    |                                                ~~~~~~

Check warning on line 127 in halo2_gadgets/src/utilities.rs

See this annotation in the file changed.

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

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
   --> halo2_gadgets/src/utilities.rs:127:34
    |
127 |             _phantom: PhantomData::default(),
    |                                  ^^^^^^^^^^^ help: remove this call to `default`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 118 in halo2_gadgets/src/utilities.rs

See this annotation in the file changed.

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

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
   --> halo2_gadgets/src/utilities.rs:118:34
    |
118 |             _phantom: PhantomData::default(),
    |                                  ^^^^^^^^^^^ help: remove this call to `default`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 103 in halo2_gadgets/src/utilities.rs

See this annotation in the file changed.

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

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
   --> halo2_gadgets/src/utilities.rs:103:34
    |
103 |             _phantom: PhantomData::default(),
    |                                  ^^^^^^^^^^^ help: remove this call to `default`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 52 in halo2_gadgets/src/utilities/lookup_range_check.rs

See this annotation in the file changed.

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

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
  --> halo2_gadgets/src/utilities/lookup_range_check.rs:52:38
   |
52 |                 _phantom: PhantomData::default(),
   |                                      ^^^^^^^^^^^ help: remove this call to `default`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 660 in halo2_gadgets/src/sinsemilla.rs

See this annotation in the file changed.

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

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   --> halo2_gadgets/src/sinsemilla.rs:660:48
    |
660 | ...                   .chain(right.into_iter()),
    |                              ^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `right`
    |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   --> /rustc/202008a1b8de96d2e5b6bc02d379db03a877d34d/library/core/src/iter/traits/iterator.rs:471:12
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 659 in halo2_gadgets/src/sinsemilla.rs

See this annotation in the file changed.

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

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   --> halo2_gadgets/src/sinsemilla.rs:659:48
    |
659 | ...                   .chain(left.into_iter())
    |                              ^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `left`
    |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   --> /rustc/202008a1b8de96d2e5b6bc02d379db03a877d34d/library/core/src/iter/traits/iterator.rs:471:12
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
    = note: `-W clippy::useless-conversion` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::useless_conversion)]`

Check warning on line 1066 in halo2_proofs/src/dev.rs

See this annotation in the file changed.

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

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try`
    --> halo2_proofs/src/dev.rs:1066:30
     |
1066 | ...                   .fold(Ok(()), |acc, res| acc.and(res))
     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold((), |acc, res| ...)`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold
     = note: `-W clippy::manual-try-fold` implied by `-W clippy::all`
     = help: to override `-W clippy::all` add `#[allow(clippy::manual_try_fold)]`

Check warning on line 688 in halo2_proofs/src/dev.rs

See this annotation in the file changed.

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

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> halo2_proofs/src/dev.rs:683:41
    |
683 | / ...                   &util::load_instance(
684 | | ...                       n,
685 | | ...                       row,
686 | | ...                       &self.cs.instance_queries,
687 | | ...                       &self.instance,
688 | | ...                   ),
    | |_______________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
help: change this to
    |
683 ~                                         util::load_instance(
684 +                                             n,
685 +                                             row,
686 +                                             &self.cs.instance_queries,
687 +                                             &self.instance,
688 ~                                         ),
    |

Check warning on line 682 in halo2_proofs/src/dev.rs

See this annotation in the file changed.

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

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> halo2_proofs/src/dev.rs:682:41
    |
682 | ...                   &util::load(n, row, &self.cs.advice_queries, &self.advice),
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `util::load(n, row, &self.cs.advice_queries, &self.advice)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 681 in halo2_proofs/src/dev.rs

See this annotation in the file changed.

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

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> halo2_proofs/src/dev.rs:681:41
    |
681 | ...                   &util::load(n, row, &self.cs.fixed_queries, &self.fixed),
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `util::load(n, row, &self.cs.fixed_queries, &self.fixed)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 352 in halo2_proofs/src/dev/tfp.rs

See this annotation in the file changed.

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

the following explicit lifetimes could be elided: 'cs

warning: the following explicit lifetimes could be elided: 'cs
   --> halo2_proofs/src/dev/tfp.rs:352:6
    |
352 | impl<'cs, F: Field, CS: Assignment<F>> Assignment<F> for TracingAssignment<'cs, F, CS> {
    |      ^^^                                                                   ^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
352 - impl<'cs, F: Field, CS: Assignment<F>> Assignment<F> for TracingAssignment<'cs, F, CS> {
352 + impl<F: Field, CS: Assignment<F>> Assignment<F> for TracingAssignment<'_, F, CS> {
    |

Check warning on line 225 in halo2_proofs/src/dev/tfp.rs

See this annotation in the file changed.

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

the following explicit lifetimes could be elided: 'r

warning: the following explicit lifetimes could be elided: 'r
   --> halo2_proofs/src/dev/tfp.rs:225:6
    |
225 | impl<'r, F: Field> RegionLayouter<F> for TracingRegion<'r, F> {
    |      ^^                                                ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
225 - impl<'r, F: Field> RegionLayouter<F> for TracingRegion<'r, F> {
225 + impl<F: Field> RegionLayouter<F> for TracingRegion<'_, F> {
    |

Check warning on line 121 in halo2_proofs/src/dev/tfp.rs

See this annotation in the file changed.

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

the following explicit lifetimes could be elided: 'c

warning: the following explicit lifetimes could be elided: 'c
   --> halo2_proofs/src/dev/tfp.rs:121:6
    |
121 | impl<'c, F: Field, C: Circuit<F>> Circuit<F> for TracingCircuit<'c, F, C> {
    |      ^^                                                         ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
121 - impl<'c, F: Field, C: Circuit<F>> Circuit<F> for TracingCircuit<'c, F, C> {
121 + impl<F: Field, C: Circuit<F>> Circuit<F> for TracingCircuit<'_, F, C> {
    |

Check warning on line 284 in halo2_gadgets/src/sha256/table16/compression/compression_gates.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_gadgets/src/sha256/table16/compression/compression_gates.rs:280:10
    |
280 |       ) -> Constraints<
    |  __________^
281 | |         F,
282 | |         (&'static str, Expression<F>),
283 | |         impl Iterator<Item = (&'static str, Expression<F>)>,
284 | |     > {
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 109 in halo2_gadgets/src/sha256/table16/compression/compression_gates.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_gadgets/src/sha256/table16/compression/compression_gates.rs:105:10
    |
105 |       ) -> Constraints<
    |  __________^
106 | |         F,
107 | |         (&'static str, Expression<F>),
108 | |         impl Iterator<Item = (&'static str, Expression<F>)>,
109 | |     > {
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 41 in halo2_gadgets/src/sha256/table16/compression/compression_gates.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_gadgets/src/sha256/table16/compression/compression_gates.rs:37:10
   |
37 |       ) -> Constraints<
   |  __________^
38 | |         F,
39 | |         (&'static str, Expression<F>),
40 | |         impl Iterator<Item = (&'static str, Expression<F>)>,
41 | |     > {
   | |_____^
   |
   = 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`
   = help: to override `-W clippy::all` add `#[allow(clippy::type_complexity)]`

Check warning on line 414 in halo2_proofs/src/dev/cost.rs

See this annotation in the file changed.

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

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
   --> halo2_proofs/src/dev/cost.rs:414:33
    |
414 |             _marker: PhantomData::default(),
    |                                 ^^^^^^^^^^^ help: remove this call to `default`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 371 in halo2_proofs/src/dev/cost.rs

See this annotation in the file changed.

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

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
   --> halo2_proofs/src/dev/cost.rs:371:33
    |
371 |             _marker: PhantomData::default(),
    |                                 ^^^^^^^^^^^ help: remove this call to `default`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 198 in halo2_gadgets/src/poseidon.rs

See this annotation in the file changed.

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

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
   --> halo2_gadgets/src/poseidon.rs:198:33
    |
198 |             _marker: PhantomData::default(),
    |                                 ^^^^^^^^^^^ help: remove this call to `default`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 328 in halo2_proofs/src/dev/cost.rs

See this annotation in the file changed.

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

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
   --> halo2_proofs/src/dev/cost.rs:328:33
    |
328 |             _marker: PhantomData::default(),
    |                                 ^^^^^^^^^^^ help: remove this call to `default`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 152 in halo2_gadgets/src/poseidon.rs

See this annotation in the file changed.

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

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
   --> halo2_gadgets/src/poseidon.rs:152:33
    |
152 |             _marker: PhantomData::default(),
    |                                 ^^^^^^^^^^^ help: remove this call to `default`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
    = note: `-W clippy::default-constructed-unit-structs` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::default_constructed_unit_structs)]`

Check warning on line 517 in halo2_gadgets/src/poseidon/pow5.rs

See this annotation in the file changed.

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

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> halo2_gadgets/src/poseidon/pow5.rs:517:77
    |
517 |                 let r_0 = (p[0] + config.round_constants[round + 1][0]).pow(&config.alpha);
    |                                                                             ^^^^^^^^^^^^^ help: change this to: `config.alpha`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args