Merge pull request #22 from longerd/dev #78
clippy
49 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 49 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.84.0-nightly (03ee48451 2024-11-18)
- cargo 1.84.0-nightly (69e595908 2024-11-16)
- clippy 0.1.84 (03ee484519 2024-11-18)
Annotations
Check warning on line 57 in src/stark.rs
github-actions / clippy
use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
warning: use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
--> src/stark.rs:57:5
|
57 | async fn prove(
| ^^^^^
|
= note: you can suppress this lint if you plan to use the trait only in your own code, or do not care about auto traits like `Send` on the `Future`
= note: `#[warn(async_fn_in_trait)]` on by default
help: you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`, but these cannot be relaxed without a breaking API change
|
57 ~ fn prove(
58 | &self,
59 | options: ProofOptions,
60 | witness: Self::Witness,
61 ~ ) -> impl std::future::Future<Output = Result<Proof<Self>, ProvingError>> + Send {async {
62 | default_prove(self, options, witness)
63 ~ } }
|
Check warning on line 60 in src/verifier.rs
github-actions / clippy
using `map` over `inspect`
warning: using `map` over `inspect`
--> src/verifier.rs:60:65
|
60 | let extension_trace_commitment = extension_trace_commitment.map(|commitment| {
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
= note: `#[warn(clippy::manual_inspect)]` implied by `#[warn(clippy::all)]`
help: try
|
60 ~ let extension_trace_commitment = extension_trace_commitment.inspect(|commitment| {
61 ~ public_coin.reseed_with_digest(commitment);
|
Check warning on line 648 in src/utils.rs
github-actions / clippy
first doc comment paragraph is too long
warning: first doc comment paragraph is too long
--> src/utils.rs:633:5
|
633 | / /// Generates a single column matrix consisting of two values i.e.
634 | | /// βββββββββ
635 | | /// β Col 0 β
636 | | /// βββββββββ€
... |
647 | | /// β ... β
648 | | /// βββββββββ
| |____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
help: add an empty line
|
633 ~ /// Generates a single column matrix consisting of two values i.e.
634 + ///
635 ~ /// βββββββββ
|
Check warning on line 616 in src/utils.rs
github-actions / clippy
first doc comment paragraph is too long
warning: first doc comment paragraph is too long
--> src/utils.rs:605:5
|
605 | / /// Generates a matrix of fibbonacci sequence across two columns i.e.
606 | | /// βββββββββ¬ββββββββ
607 | | /// β Col 0 | Col 1 β
608 | | /// βββββββββΌββββββββ€
... |
615 | | /// β ... β ... β ...
616 | | /// βββββββββ΄ββββββββ
| |____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
= note: `#[warn(clippy::too_long_first_doc_paragraph)]` implied by `#[warn(clippy::nursery)]`
help: add an empty line
|
605 ~ /// Generates a matrix of fibbonacci sequence across two columns i.e.
606 + ///
607 ~ /// βββββββββ¬ββββββββ
|
Check warning on line 183 in src/prover.rs
github-actions / clippy
item in documentation is missing backticks
warning: item in documentation is missing backticks
--> src/prover.rs:183:28
|
183 | /// Bit reverses the first ce_domain_size many values of the matrix columns.
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
note: the lint level is defined here
--> src/lib.rs:1:22
|
1 | #![warn(clippy::all, clippy::pedantic, clippy::cargo, clippy::nursery)]
| ^^^^^^^^^^^^^^^^
= note: `#[warn(clippy::doc_markdown)]` implied by `#[warn(clippy::pedantic)]`
help: try
|
183 | /// Bit reverses the first `ce_domain_size` many values of the matrix columns.
| ~~~~~~~~~~~~~~~~
Check warning on line 31 in src/matrix.rs
github-actions / clippy
this could be a `const fn`
warning: this could be a `const fn`
--> src/matrix.rs:29:5
|
29 | / pub fn new(cols: Vec<GpuVec<F>>) -> Self {
30 | | Self(cols)
31 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
help: make the function `const`
|
29 | pub const fn new(cols: Vec<GpuVec<F>>) -> Self {
| +++++
Check warning on line 90 in src/fri.rs
github-actions / clippy
this could be a `const fn`
warning: this could be a `const fn`
--> src/fri.rs:85:5
|
85 | / pub fn new(layers: Vec<LayerProof<F, D, M>>, remainder_coeffs: Vec<F>) -> Self {
86 | | Self {
87 | | layers,
88 | | remainder_coeffs,
89 | | }
90 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
help: make the function `const`
|
85 | pub const fn new(layers: Vec<LayerProof<F, D, M>>, remainder_coeffs: Vec<F>) -> Self {
| +++++
github-actions / clippy
temporary with significant `Drop` in `if let` scrutinee will live until the end of the `if let` expression
warning: temporary with significant `Drop` in `if let` scrutinee will live until the end of the `if let` expression
--> src/expression.rs:127:37
|
127 | if let Some(node) = sn.get(&addr_of!(*this.read().unwrap())) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
131 | let res = Arc::new(RwLock::new(match &*this.read().unwrap() {
| -------------------- another value with significant `Drop` created here
...
139 | sn.insert(addr_of!(*this.read().unwrap()), Arc::clone(&res));
| -------------------- another value with significant `Drop` created here
...
157 | sn.insert(addr_of!(*this.read().unwrap()), Arc::clone(&res));
| -------------------- another value with significant `Drop` created here
158 | res
159 | }
| - temporary lives until here
|
= note: this might lead to deadlocks or other unexpected behavior
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_in_scrutinee
= note: `#[warn(clippy::significant_drop_in_scrutinee)]` implied by `#[warn(clippy::nursery)]`
= note: this warning originates in the macro `addr_of` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 474 in src/eval_cpu.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/eval_cpu.rs:474:6
|
474 | impl<'a, Fp: Field, Fq: Field, const N: usize> Neg for EvalItem<'a, Fp, Fq, N> {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
474 - impl<'a, Fp: Field, Fq: Field, const N: usize> Neg for EvalItem<'a, Fp, Fq, N> {
474 + impl<Fp: Field, Fq: Field, const N: usize> Neg for EvalItem<'_, Fp, Fq, N> {
|
Check warning on line 447 in src/eval_cpu.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/eval_cpu.rs:447:6
|
447 | impl<'a, Fp: Field, Fq: Field, const N: usize> Pow<usize> for EvalItem<'a, Fp, Fq, N> {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
447 - impl<'a, Fp: Field, Fq: Field, const N: usize> Pow<usize> for EvalItem<'a, Fp, Fq, N> {
447 + impl<Fp: Field, Fq: Field, const N: usize> Pow<usize> for EvalItem<'_, Fp, Fq, N> {
|
Check warning on line 431 in src/eval_cpu.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/eval_cpu.rs:431:9
|
431 | 'a,
| ^^
...
435 | > Div for EvalItem<'a, Fp, Fq, N>
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
431 ~ Fp: Field,
432 | Fq: Field + From<Fp> + Mul<Fp, Output = Fq> + MulAssign<Fp>,
433 | const N: usize,
434 ~ > Div for EvalItem<'_, Fp, Fq, N>
|
Check warning on line 358 in src/eval_cpu.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/eval_cpu.rs:358:9
|
358 | 'a,
| ^^
...
362 | > Mul for EvalItem<'a, Fp, Fq, N>
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
358 ~ Fp: Field,
359 | Fq: Field + From<Fp> + Mul<Fp, Output = Fq> + MulAssign<Fp>,
360 | const N: usize,
361 ~ > Mul for EvalItem<'_, Fp, Fq, N>
|
Check warning on line 298 in src/eval_cpu.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/eval_cpu.rs:298:9
|
298 | 'a,
| ^^
...
302 | > Add for EvalItem<'a, Fp, Fq, N>
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
298 ~ Fp: Field,
299 | Fq: Field + From<Fp> + Add<Fp, Output = Fq> + AddAssign<Fp>,
300 | const N: usize,
301 ~ > Add for EvalItem<'_, Fp, Fq, N>
|
Check warning on line 265 in src/eval_cpu.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/eval_cpu.rs:265:6
|
265 | impl<'a, Fp: Field, Fq: Field + From<Fp>, const N: usize> EvalItem<'a, Fp, Fq, N> {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
265 - impl<'a, Fp: Field, Fq: Field + From<Fp>, const N: usize> EvalItem<'a, Fp, Fq, N> {
265 + impl<Fp: Field, Fq: Field + From<Fp>, const N: usize> EvalItem<'_, Fp, Fq, N> {
|
Check warning on line 124 in src/channel.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/channel.rs:124:6
|
124 | impl<'a, S: Stark> fri::ProverChannel for ProverChannel<'a, S> {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
note: the lint level is defined here
--> src/lib.rs:1:9
|
1 | #![warn(clippy::all, clippy::pedantic, clippy::cargo, clippy::nursery)]
| ^^^^^^^^^^^
= note: `#[warn(clippy::needless_lifetimes)]` implied by `#[warn(clippy::all)]`
help: elide the lifetimes
|
124 - impl<'a, S: Stark> fri::ProverChannel for ProverChannel<'a, S> {
124 + impl<S: Stark> fri::ProverChannel for ProverChannel<'_, S> {
|
Check warning on line 15 in src/challenges.rs
github-actions / clippy
this could be a `const fn`
warning: this could be a `const fn`
--> src/challenges.rs:13:5
|
13 | / pub fn new(challenges: Vec<F>) -> Self {
14 | | Self(challenges)
15 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
note: the lint level is defined here
--> src/lib.rs:1:55
|
1 | #![warn(clippy::all, clippy::pedantic, clippy::cargo, clippy::nursery)]
| ^^^^^^^^^^^^^^^
= note: `#[warn(clippy::missing_const_for_fn)]` implied by `#[warn(clippy::nursery)]`
help: make the function `const`
|
13 | pub const fn new(challenges: Vec<F>) -> Self {
| +++++
Check warning on line 293 in examples/rescue/rescue.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> examples/rescue/rescue.rs:293:50
|
293 | fn matrix_mul<F: PrimeField>(a: &Vec<Vec<F>>, b: &Vec<Vec<F>>) -> Vec<Vec<F>> {
| ^^^^^^^^^^^^ help: change this to: `&[Vec<F>]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 293 in examples/rescue/rescue.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> examples/rescue/rescue.rs:293:33
|
293 | fn matrix_mul<F: PrimeField>(a: &Vec<Vec<F>>, b: &Vec<Vec<F>>) -> Vec<Vec<F>> {
| ^^^^^^^^^^^^ help: change this to: `&[Vec<F>]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 272 in examples/rescue/rescue.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> examples/rescue/rescue.rs:272:44
|
272 | fn transpose<T: Clone + Copy + Default>(m: &Vec<Vec<T>>) -> Vec<Vec<T>> {
| ^^^^^^^^^^^^ help: change this to: `&[Vec<T>]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 219 in examples/rescue/rescue.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> examples/rescue/rescue.rs:219:30
|
219 | fn echelon_form<T: Field>(m: &Vec<Vec<T>>) -> Vec<Vec<T>> {
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
help: change this to
|
219 ~ fn echelon_form<T: Field>(m: &[Vec<T>]) -> Vec<Vec<T>> {
220 | if m.is_empty() || m[0].is_empty() {
...
227 | let mut lead = 0;
228 ~ let mut m = m.to_owned();
|
Check warning on line 332 in tests/constraint.rs
github-actions / clippy
bound is defined in more than one place
warning: bound is defined in more than one place
--> tests/constraint.rs:332:40
|
332 | fn assert_valid_over_transition_domain<F: GpuField + Field>(
| ^
...
336 | F: From<F::FftField>,
| ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations
= note: `#[warn(clippy::multiple_bound_locations)]` on by default
Check warning on line 70 in src/eval_cpu.rs
github-actions / clippy
unreachable pattern
warning: unreachable pattern
--> src/eval_cpu.rs:70:9
|
70 | _ => unreachable!(),
| ^ no value can reach this
|
note: multiple earlier patterns match some of the same values
--> src/eval_cpu.rs:70:9
|
47 | 1..512 => eval_impl::<Fp, Fq, 1>(
| ------ matches some of the same values
...
58 | 512.. => eval_impl::<Fp, Fq, 512>(
| ----- matches some of the same values
...
69 | 0 => {}
| - matches some of the same values
70 | _ => unreachable!(),
| ^ collectively making this unreachable
= note: `#[warn(unreachable_patterns)]` on by default
Check warning on line 57 in src/stark.rs
github-actions / clippy
use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
warning: use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
--> src/stark.rs:57:5
|
57 | async fn prove(
| ^^^^^
|
= note: you can suppress this lint if you plan to use the trait only in your own code, or do not care about auto traits like `Send` on the `Future`
= note: `#[warn(async_fn_in_trait)]` on by default
help: you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`, but these cannot be relaxed without a breaking API change
|
57 ~ fn prove(
58 | &self,
59 | options: ProofOptions,
60 | witness: Self::Witness,
61 ~ ) -> impl std::future::Future<Output = Result<Proof<Self>, ProvingError>> + Send {async {
62 | default_prove(self, options, witness)
63 ~ } }
|
Check warning on line 60 in src/verifier.rs
github-actions / clippy
using `map` over `inspect`
warning: using `map` over `inspect`
--> src/verifier.rs:60:65
|
60 | let extension_trace_commitment = extension_trace_commitment.map(|commitment| {
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
= note: `#[warn(clippy::manual_inspect)]` implied by `#[warn(clippy::all)]`
help: try
|
60 ~ let extension_trace_commitment = extension_trace_commitment.inspect(|commitment| {
61 ~ public_coin.reseed_with_digest(commitment);
|
Check warning on line 648 in src/utils.rs
github-actions / clippy
first doc comment paragraph is too long
warning: first doc comment paragraph is too long
--> src/utils.rs:633:5
|
633 | / /// Generates a single column matrix consisting of two values i.e.
634 | | /// βββββββββ
635 | | /// β Col 0 β
636 | | /// βββββββββ€
... |
647 | | /// β ... β
648 | | /// βββββββββ
| |____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
help: add an empty line
|
633 ~ /// Generates a single column matrix consisting of two values i.e.
634 + ///
635 ~ /// βββββββββ
|