Created
January 18, 2024 03:10
-
-
Save matthiasgoergens/f0980053f1cf6cebc4374439388b1a91 to your computer and use it in GitHub Desktop.
OlaVM clippy complaints
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/m/p/o/olavm (main)$ git rev-parse HEAD && cargo clippy | |
d9fc2ff0a465f31dfd90f93dd3e02053818fe0d6 | |
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` | |
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest | |
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest | |
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions | |
warning: suspicious use of `*` in `Div` impl | |
--> plonky2/field/src/arch/x86_64/avx2_goldilocks_field.rs:86:14 | |
| | |
86 | self * rhs.inverse() | |
| ^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_arithmetic_impl | |
= note: `#[warn(clippy::suspicious_arithmetic_impl)]` on by default | |
warning: suspicious use of `*` in `DivAssign` impl | |
--> plonky2/field/src/arch/x86_64/avx2_goldilocks_field.rs:92:15 | |
| | |
92 | *self *= rhs.inverse(); | |
| ^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_op_assign_impl | |
= note: `#[warn(clippy::suspicious_op_assign_impl)]` on by default | |
warning: returning the result of a `let` binding from a block | |
--> plonky2/field/src/arch/x86_64/avx2_goldilocks_field.rs:330:5 | |
| | |
329 | let res_s = _mm256_add_epi64(res_wrapped_s, wrapback_amt); | |
| ---------------------------------------------------------- unnecessary `let` binding | |
330 | res_s | |
| ^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
= note: `#[warn(clippy::let_and_return)]` on by default | |
help: return the expression directly | |
| | |
329 ~ | |
330 ~ _mm256_add_epi64(res_wrapped_s, wrapback_amt) | |
| | |
warning: returning the result of a `let` binding from a block | |
--> plonky2/field/src/arch/x86_64/avx2_goldilocks_field.rs:349:5 | |
| | |
348 | let res = _mm256_sub_epi64(res_wrapped, wrapback_amt); | |
| ------------------------------------------------------ unnecessary `let` binding | |
349 | res | |
| ^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
help: return the expression directly | |
| | |
348 ~ | |
349 ~ _mm256_sub_epi64(res_wrapped, wrapback_amt) | |
| | |
warning: returning the result of a `let` binding from a block | |
--> plonky2/field/src/arch/x86_64/avx2_goldilocks_field.rs:444:5 | |
| | |
443 | let res_s = _mm256_add_epi64(res_wrapped_s, wrapback_amt); | |
| ---------------------------------------------------------- unnecessary `let` binding | |
444 | res_s | |
| ^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
help: return the expression directly | |
| | |
443 ~ | |
444 ~ _mm256_add_epi64(res_wrapped_s, wrapback_amt) | |
| | |
warning: returning the result of a `let` binding from a block | |
--> plonky2/field/src/arch/x86_64/avx2_goldilocks_field.rs:465:5 | |
| | |
464 | let res_s = _mm256_sub_epi64(res_wrapped_s, wrapback_amt); | |
| ---------------------------------------------------------- unnecessary `let` binding | |
465 | res_s | |
| ^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
help: return the expression directly | |
| | |
464 ~ | |
465 ~ _mm256_sub_epi64(res_wrapped_s, wrapback_amt) | |
| | |
warning: returning the result of a `let` binding from a block | |
--> plonky2/field/src/arch/x86_64/avx2_goldilocks_field.rs:477:5 | |
| | |
476 | let lo2 = shift(lo2_s); | |
| ----------------------- unnecessary `let` binding | |
477 | lo2 | |
| ^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
help: return the expression directly | |
| | |
476 ~ | |
477 ~ shift(lo2_s) | |
| | |
warning: useless conversion to the same type: `u64` | |
--> plonky2/field/src/cfft/concurrent.rs:32:36 | |
| | |
32 | let offset = g.exp_u64(idx.into()) * domain_offset; | |
| ^^^^^^^^^^ help: consider removing `.into()`: `idx` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
= note: `#[warn(clippy::useless_conversion)]` on by default | |
warning: useless conversion to the same type: `u64` | |
--> plonky2/field/src/cfft/concurrent.rs:66:52 | |
| | |
66 | let mut offset = domain_offset.exp_u64(((i * batch_size) as u64).into()) * inv_len; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `((i * batch_size) as u64)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: manual implementation of an assign operation | |
--> plonky2/field/src/cfft/concurrent.rs:68:17 | |
| | |
68 | *coeff = *coeff * offset; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*coeff *= offset` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern | |
= note: `#[warn(clippy::assign_op_pattern)]` on by default | |
warning: manual implementation of an assign operation | |
--> plonky2/field/src/cfft/concurrent.rs:69:17 | |
| | |
69 | offset = offset * domain_offset; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `offset *= domain_offset` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern | |
warning: useless conversion to the same type: `u64` | |
--> plonky2/field/src/cfft/concurrent.rs:102:32 | |
| | |
102 | debug_assert_eq!(g.exp_u64((n as u64).into()), F::ONE); | |
| ^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `(n as u64)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> plonky2/field/src/cfft/concurrent.rs:116:58 | |
| | |
116 | .for_each(|row| super::serial::fft_in_place(row, &twiddles, stretch, stretch, 0)); | |
| ^^^^^^^^^ help: change this to: `twiddles` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
= note: `#[warn(clippy::needless_borrow)]` on by default | |
warning: useless conversion to the same type: `u64` | |
--> plonky2/field/src/cfft/concurrent.rs:128:47 | |
| | |
128 | let inner_twiddle = g.exp_u64((i as u64).into()); | |
| ^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `(i as u64)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: manual implementation of an assign operation | |
--> plonky2/field/src/cfft/concurrent.rs:131:21 | |
| | |
131 | *element = (*element) * outer_twiddle; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*element *= outer_twiddle` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern | |
warning: manual implementation of an assign operation | |
--> plonky2/field/src/cfft/concurrent.rs:132:21 | |
| | |
132 | outer_twiddle = outer_twiddle * inner_twiddle; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `outer_twiddle *= inner_twiddle` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> plonky2/field/src/cfft/concurrent.rs:135:46 | |
| | |
135 | super::serial::fft_in_place(row, &twiddles, 1, 1, 0) | |
| ^^^^^^^^^ help: change this to: `twiddles` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: useless conversion to the same type: `u64` | |
--> plonky2/field/src/cfft/concurrent.rs:193:45 | |
| | |
193 | let mut factor = offset.exp_u64(((i * batch_size) as u64).into()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `((i * batch_size) as u64)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: manual implementation of an assign operation | |
--> plonky2/field/src/cfft/concurrent.rs:196:17 | |
| | |
196 | factor = factor * offset; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `factor *= offset` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern | |
warning: manual implementation of an assign operation | |
--> plonky2/field/src/cfft/serial.rs:149:5 | |
| | |
149 | values[j] = values[j] * twiddle; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `values[j] *= twiddle` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern | |
warning: unsafe function's docs miss `# Safety` section | |
--> plonky2/field/src/cfft/mod.rs:226:1 | |
| | |
226 | pub unsafe fn uninit_vector<T>(length: usize) -> Vec<T> { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc | |
= note: `#[warn(clippy::missing_safety_doc)]` on by default | |
warning: the function `evaluate_poly_with_offset` doesn't need a mutable reference | |
--> plonky2/field/src/polynomial/mod.rs:95:43 | |
| | |
95 | let v = evaluate_poly_with_offset(&mut v, &twiddles, F::coset_shift(), blowup_factor); | |
| ^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed | |
= note: `#[warn(clippy::unnecessary_mut_passed)]` on by default | |
warning: called `unwrap` on `twiddles` after checking its variant with `is_some` | |
--> plonky2/field/src/polynomial/mod.rs:294:48 | |
| | |
293 | if twiddles.is_some() { | |
| --------------------- help: try: `if let Some(..) = twiddles` | |
294 | self.coset_fft_with_options(shift, twiddles.unwrap(), 1) | |
| ^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap | |
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default | |
warning: the function `evaluate_poly_with_offset` doesn't need a mutable reference | |
--> plonky2/field/src/polynomial/mod.rs:309:43 | |
| | |
309 | let v = evaluate_poly_with_offset(&mut v, twiddles, shift, blowup_factor); | |
| ^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed | |
warning: `plonky2_field` (lib) generated 24 warnings (run `cargo clippy --fix --lib -p plonky2_field` to apply 18 suggestions) | |
warning: unused imports: `LookupTableGate`, `LookupTable` | |
--> plonky2/plonky2/src/gadgets/lookup.rs:4:49 | |
| | |
4 | BitwiseLookupTable, BitwiseLookupTableGate, LookupTable, LookupTableGate, | |
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^ | |
| | |
= note: `#[warn(unused_imports)]` on by default | |
warning: unused import: `ROUNDS` | |
--> plonky2/plonky2/src/gates/poseidon2.rs:10:41 | |
| | |
10 | use crate::hash::poseidon2::{Poseidon2, ROUNDS, ROUND_F_BEGIN, ROUND_F_END, ROUND_P, WIDTH}; | |
| ^^^^^^ | |
warning: unused import: `std::time::Instant` | |
--> plonky2/plonky2/src/gates/gate_testing.rs:1:5 | |
| | |
1 | use std::time::Instant; | |
| ^^^^^^^^^^^^^^^^^^ | |
warning: unused import: `Extendable` | |
--> plonky2/plonky2/src/hash/blake3.rs:14:32 | |
| | |
14 | use plonky2_field::extension::{Extendable, FieldExtension}; | |
| ^^^^^^^^^^ | |
warning: operator precedence can trip the unwary | |
--> plonky2/plonky2/src/hash/blake3.rs:212:64 | |
| | |
212 | slice::from_raw_parts(input.as_ptr() as *const u8, input.len() * F::BITS >> 3) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(input.len() * F::BITS) >> 3` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence | |
= note: `#[warn(clippy::precedence)]` on by default | |
warning: unused import: `std::borrow::BorrowMut` | |
--> plonky2/plonky2/src/hash/utils.rs:1:5 | |
| | |
1 | use std::borrow::BorrowMut; | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
warning: unused import: `zip_eq` | |
--> plonky2/plonky2/src/iop/witness.rs:3:17 | |
| | |
3 | use itertools::{zip_eq, Itertools}; | |
| ^^^^^^ | |
warning: unused import: `alloc::sync::Arc` | |
--> plonky2/plonky2/src/plonk/circuit_builder.rs:1:5 | |
| | |
1 | use alloc::sync::Arc; | |
| ^^^^^^^^^^^^^^^^ | |
warning: unused imports: `LookupGate`, `Lookup` | |
--> plonky2/plonky2/src/plonk/circuit_builder.rs:24:62 | |
| | |
24 | use crate::gates::lookup::{BitwiseLookup, BitwiseLookupGate, Lookup, LookupGate}; | |
| ^^^^^^ ^^^^^^^^^^ | |
warning: unused import: `LookupTable` | |
--> plonky2/plonky2/src/plonk/circuit_builder.rs:25:54 | |
| | |
25 | use crate::gates::lookup_table::{BitwiseLookupTable, LookupTable}; | |
| ^^^^^^^^^^^ | |
warning: unused import: `Lookup` | |
--> plonky2/plonky2/src/plonk/circuit_data.rs:18:43 | |
| | |
18 | use crate::gates::lookup::{BitwiseLookup, Lookup}; | |
| ^^^^^^ | |
warning: unused import: `LookupGate` | |
--> plonky2/plonky2/src/plonk/prover.rs:18:47 | |
| | |
18 | use crate::gates::lookup::{BitwiseLookupGate, LookupGate}; | |
| ^^^^^^^^^^ | |
warning: unused import: `LookupTableGate` | |
--> plonky2/plonky2/src/plonk/prover.rs:19:58 | |
| | |
19 | use crate::gates::lookup_table::{BitwiseLookupTableGate, LookupTableGate}; | |
| ^^^^^^^^^^^^^^^ | |
warning: unused import: `LookupGate` | |
--> plonky2/plonky2/src/plonk/vanishing_poly.rs:14:47 | |
| | |
14 | use crate::gates::lookup::{BitwiseLookupGate, LookupGate}; | |
| ^^^^^^^^^^ | |
warning: unused import: `LookupTableGate` | |
--> plonky2/plonky2/src/plonk/vanishing_poly.rs:15:58 | |
| | |
15 | use crate::gates::lookup_table::{BitwiseLookupTableGate, LookupTableGate}; | |
| ^^^^^^^^^^^^^^^ | |
warning: unused import: `Field` | |
--> plonky2/plonky2/src/hash/blake3.rs:15:28 | |
| | |
15 | use plonky2_field::types::{Field, PrimeField64}; | |
| ^^^^^ | |
warning: type parameter `C` goes unused in function definition | |
--> plonky2/plonky2/src/fri/proof.rs:248:29 | |
| | |
248 | pub(crate) fn decompress<C: GenericConfig<D, F = F, Hasher = H>>( | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the parameter | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
= note: `#[warn(clippy::extra_unused_type_parameters)]` on by default | |
warning: type parameter `C` goes unused in function definition | |
--> plonky2/plonky2/src/fri/recursive_verifier.rs:28:26 | |
| | |
28 | fn compute_evaluation<C: GenericConfig<D, F = F>>( | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the parameter | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
warning: type parameter `C` goes unused in function definition | |
--> plonky2/plonky2/src/fri/recursive_verifier.rs:73:30 | |
| | |
73 | fn check_recursion_config<C: GenericConfig<D, F = F>>(&self, max_fri_arity_bits: usize) { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the parameter | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
warning: type parameter `H` goes unused in function definition | |
--> plonky2/plonky2/src/fri/recursive_verifier.rs:107:32 | |
| | |
107 | fn fri_verify_proof_of_work<H: AlgebraicHasher<F>>( | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the parameter | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
warning: type parameter `C` goes unused in function definition | |
--> plonky2/plonky2/src/fri/recursive_verifier.rs:223:27 | |
| | |
223 | fn fri_combine_initial<C: GenericConfig<D, F = F>>( | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the parameter | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
warning: this operation has no effect | |
--> plonky2/plonky2/src/gates/lookup.rs:108:9 | |
| | |
108 | 3 * i + 0 | |
| ^^^^^^^^^ help: consider reducing it to: `3 * i` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op | |
= note: `#[warn(clippy::identity_op)]` on by default | |
warning: a `Vec` of `Range` that is only one element | |
--> plonky2/plonky2/src/gates/selectors.rs:134:25 | |
| | |
134 | groups: vec![0..num_gates], | |
| ^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init | |
= note: `#[warn(clippy::single_range_in_vec_init)]` on by default | |
help: if you wanted a `Vec` that contains the entire range, try | |
| | |
134 | groups: (0..num_gates).collect::<std::vec::Vec<usize>>(), | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: this operation has no effect | |
--> plonky2/plonky2/src/hash/blake3.rs:90:64 | |
| | |
90 | block_words[1] = u32::from_le_bytes(*array_ref!(block, 1 * 4, 4)); | |
| ^^^^^ help: consider reducing it to: `4` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op | |
warning: casting raw pointers to the same type and constness is unnecessary (`*const u8` -> `*const u8`) | |
--> plonky2/plonky2/src/hash/blake3.rs:222:51 | |
| | |
222 | let left = unsafe { slice::from_raw_parts(left.0.as_ptr() as *const u8, 32) }; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `left.0.as_ptr()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast | |
= note: `#[warn(clippy::unnecessary_cast)]` on by default | |
warning: casting raw pointers to the same type and constness is unnecessary (`*const u8` -> `*const u8`) | |
--> plonky2/plonky2/src/hash/blake3.rs:224:52 | |
| | |
224 | let right = unsafe { slice::from_raw_parts(right.0.as_ptr() as *const u8, 32) }; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `right.0.as_ptr()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> plonky2/plonky2/src/hash/merkle_tree/mod.rs:195:39 | |
| | |
195 | for (j, value) in (0..leaves[0].len()).into_iter().zip(row_buf.iter_mut()) { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..leaves[0].len())` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
= note: `#[warn(clippy::useless_conversion)]` on by default | |
warning: it looks like you're manually copying between slices | |
--> plonky2/plonky2/src/hash/merkle_tree/mod.rs:219:13 | |
| | |
219 | / for i in 0..len_cap { | |
220 | | cap[i] = row_hashes[i]; | |
221 | | } | |
| |_____________^ help: try replacing the loop by: `cap[..len_cap].copy_from_slice(&row_hashes[..len_cap]);` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy | |
= note: `#[warn(clippy::manual_memcpy)]` on by default | |
warning: it looks like you're manually copying between slices | |
--> plonky2/plonky2/src/hash/merkle_tree/mod.rs:223:13 | |
| | |
223 | / for i in 0..len_cap { | |
224 | | cap[i] = nodes[i + len_cap]; | |
225 | | } | |
| |_____________^ help: try replacing the loop by: `cap[..len_cap].copy_from_slice(&nodes[len_cap..(len_cap + len_cap)]);` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> plonky2/plonky2/src/hash/merkle_tree/mod.rs:286:24 | |
| | |
286 | let siblings = (0..num_layers) | |
| ________________________^ | |
287 | | .into_iter() | |
| |________________________^ help: consider removing `.into_iter()`: `(0..num_layers)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: manual implementation of an assign operation | |
--> plonky2/plonky2/src/hash/poseidon2.rs:281:13 | |
| | |
281 | input[i] = input[i] * (F::from_canonical_u64(mat_internal_diag_m_1[i] - 1)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `input[i] *= (F::from_canonical_u64(mat_internal_diag_m_1[i] - 1))` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern | |
= note: `#[warn(clippy::assign_op_pattern)]` on by default | |
warning: this operation has no effect | |
--> plonky2/plonky2/src/hash/poseidon2.rs:411:66 | |
| | |
411 | builder.mul_const_add_extension(Self::ONE, input[i * 4 + 0], input[i * 4 + 1]); | |
| ^^^^^^^^^ help: consider reducing it to: `i * 4` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op | |
warning: this operation has no effect | |
--> plonky2/plonky2/src/hash/poseidon2.rs:424:19 | |
| | |
424 | input[i * 4 + 0] = t_6; | |
| ^^^^^^^^^ help: consider reducing it to: `i * 4` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op | |
warning: casting integer literal to `u8` is unnecessary | |
--> plonky2/plonky2/src/hash/utils.rs:32:30 | |
| | |
32 | let mut bytes = vec![0 as u8; padding_count]; | |
| ^^^^^^^ help: try: `0_u8` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast | |
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do | |
--> plonky2/plonky2/src/hash/utils.rs:46:12 | |
| | |
46 | input: &Vec<F>, | |
| ^^^^^^^ help: change this to: `&[F]` | |
| | |
= 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 | |
warning: manual implementation of an assign operation | |
--> plonky2/plonky2/src/hash/utils.rs:90:9 | |
| | |
90 | *field = *field + F::from_canonical_u64(offset); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*field += F::from_canonical_u64(offset)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> plonky2/plonky2/src/plonk/recursive_aggregate_verifier.rs:55:53 | |
| | |
55 | let pt = builder.add_virtual_proof_with_pis(&inner_cd); | |
| ^^^^^^^^^ help: change this to: `inner_cd` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
= note: `#[warn(clippy::needless_borrow)]` on by default | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> plonky2/plonky2/src/plonk/recursive_aggregate_verifier.rs:68:47 | |
| | |
68 | builder.verify_proof(pt, &inner_data, &inner_cd); | |
| ^^^^^^^^^ help: change this to: `inner_cd` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: `plonky2` (lib) generated 38 warnings (run `cargo clippy --fix --lib -p plonky2` to apply 31 suggestions) | |
warning: unused import: `PoseidonRow` | |
--> core/src/merkle_tree/patch.rs:5:38 | |
| | |
5 | use crate::trace::trace::{HashTrace, PoseidonRow}; | |
| ^^^^^^^^^^^ | |
| | |
= note: `#[warn(unused_imports)]` on by default | |
warning: unused import: `crate::trace::trace::PoseidonRow` | |
--> core/src/merkle_tree/tree.rs:8:5 | |
| | |
8 | use crate::trace::trace::PoseidonRow; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
warning: unused import: `TreeValue` | |
--> core/src/merkle_tree/tree.rs:12:66 | |
| | |
12 | LevelIndex, NodeEntry, TreeKey, TreeMetadata, TreeOperation, TreeValue, ZkHash, | |
| ^^^^^^^^^ | |
warning: this `else { if .. }` block can be collapsed | |
--> core/src/program/binary_program.rs:285:20 | |
| | |
285 | } else { | |
| ____________________^ | |
286 | | if matched_op1_reg.is_some() { | |
287 | | Some(OlaOperand::RegisterOperand { | |
288 | | register: matched_op1_reg.unwrap(), | |
... | | |
296 | | } | |
297 | | } | |
| |_____________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if | |
= note: `#[warn(clippy::collapsible_else_if)]` on by default | |
help: collapse nested if block | |
| | |
285 ~ } else if matched_op1_reg.is_some() { | |
286 + Some(OlaOperand::RegisterOperand { | |
287 + register: matched_op1_reg.unwrap(), | |
288 + }) | |
289 + } else if opcode == OlaOpcode::MOV { | |
290 + Some(OlaOperand::SpecialReg { | |
291 + special_reg: OlaSpecialRegister::PSP, | |
292 + }) | |
293 + } else { | |
294 + None | |
295 + } | |
| | |
warning: unused import: `u8_arr_to_tree_key` | |
--> core/src/state/state_storage.rs:3:53 | |
| | |
3 | use crate::types::merkle_tree::{tree_key_to_u8_arr, u8_arr_to_tree_key, TreeValue}; | |
| ^^^^^^^^^^^^^^^^^^ | |
warning: variable does not need to be mutable | |
--> core/src/state/state_storage.rs:67:13 | |
| | |
67 | let mut res = self.db.get_cf(cf, code_hash); | |
| ----^^^ | |
| | | |
| help: remove this `mut` | |
| | |
= note: `#[warn(unused_mut)]` on by default | |
warning: associated function `all` is never used | |
--> core/src/storage/db.rs:61:8 | |
| | |
60 | impl StateKeeperColumnFamily { | |
| ---------------------------- associated function in this implementation | |
61 | fn all() -> &'static [Self] { | |
| ^^^ | |
| | |
= note: `#[warn(dead_code)]` on by default | |
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do | |
--> core/src/crypto/hash.rs:7:33 | |
| | |
7 | fn hash_bytes(&self, value: &Vec<GoldilocksField>) -> Hash; | |
| ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[GoldilocksField]` | |
| | |
= 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 | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/crypto/poseidon.rs:19:71 | |
| | |
19 | hash_n_to_hash_no_pad::<GoldilocksField, PoseidonPermutation>(&value).elements | |
| ^^^^^^ help: change this to: `value` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
= note: `#[warn(clippy::needless_borrow)]` on by default | |
warning: unneeded `return` statement | |
--> core/src/crypto/poseidon_trace.rs:181:5 | |
| | |
181 | / return ( | |
182 | | state[0..4].try_into().expect("slice with incorrect length"), | |
183 | | rows, | |
184 | | ); | |
| |_____^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
= note: `#[warn(clippy::needless_return)]` on by default | |
help: remove `return` | |
| | |
181 ~ ( | |
182 + state[0..4].try_into().expect("slice with incorrect length"), | |
183 + rows, | |
184 ~ ) | |
| | |
warning: very complex type used. Consider factoring parts into `type` definitions | |
--> core/src/merkle_tree/patch.rs:113:10 | |
| | |
113 | ) -> Result<(TreePatch, Arc<Mutex<Vec<(usize, HashTrace)>>>), TreeError> | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity | |
= note: `#[warn(clippy::type_complexity)]` on by default | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/patch.rs:128:38 | |
| | |
128 | ... .map(|e| e.changes.last().unwrap().1.hash().clone()) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*e.changes.last().unwrap().1.hash()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
= note: `#[warn(clippy::clone_on_copy)]` on by default | |
warning: using `clone` on type `U256` which implements the `Copy` trait | |
--> core/src/merkle_tree/patch.rs:130:26 | |
| | |
130 | (key.clone(), changes) | |
| ^^^^^^^^^^^ help: try dereferencing it: `*key` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/patch.rs:182:62 | |
| | |
182 | ... .map(|(key, node)| (key, node.hash().clone())) | |
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*node.hash()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Vec` | |
--> core/src/merkle_tree/patch.rs:196:38 | |
| | |
196 | ... .into_iter() | |
| ^^^^^^^^^ help: call directly: `iter_mut` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref | |
= note: `#[warn(clippy::into_iter_on_ref)]` on by default | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/patch.rs:204:37 | |
| | |
204 | / ... mutex_data!(cur_path_map) | |
205 | | ... .get_mut(&cur_key) | |
206 | | ... .unwrap() | |
207 | | ... .get(update_index) | |
... | | |
211 | | ... .unwrap() | |
212 | | ... .clone() | |
| |__________________________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
help: try dereferencing it | |
| | |
204 ~ *mutex_data!(cur_path_map) | |
205 + .get_mut(&cur_key) | |
206 + .unwrap() | |
207 + .get(update_index) | |
208 + .unwrap() | |
209 + .uncles | |
210 + .last() | |
211 + .unwrap() | |
| | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/patch.rs:214:37 | |
| | |
214 | ... cur_change.get(update_index - 1).unwrap().clone() | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*cur_change.get(update_index - 1).unwrap()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/patch.rs:235:41 | |
| | |
235 | ... current_hash.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `current_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/patch.rs:236:41 | |
| | |
236 | ... nei_hash.clone(), | |
| ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `nei_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: use of `flat_map` with an identity function | |
--> core/src/merkle_tree/patch.rs:266:34 | |
| | |
266 | ... .flat_map(|e| e) | |
| ^^^^^^^^^^^^^^^ help: try: `flatten()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity | |
= note: `#[warn(clippy::flat_map_identity)]` on by default | |
warning: unneeded `return` statement | |
--> core/src/merkle_tree/storage.rs:216:9 | |
| | |
216 | return (None, block_number); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
216 - return (None, block_number); | |
216 + (None, block_number) | |
| | |
warning: returning the result of a `let` binding from a block | |
--> core/src/merkle_tree/storage.rs:232:5 | |
| | |
226 | / let key = [ | |
227 | | GoldilocksField::from_canonical_u64(leaf_index), | |
228 | | GoldilocksField::ZERO, | |
229 | | GoldilocksField::ZERO, | |
230 | | GoldilocksField::ZERO, | |
231 | | ]; | |
| |______- unnecessary `let` binding | |
232 | key | |
| ^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
= note: `#[warn(clippy::let_and_return)]` on by default | |
help: return the expression directly | |
| | |
226 ~ | |
227 ~ [ | |
228 + GoldilocksField::from_canonical_u64(leaf_index), | |
229 + GoldilocksField::ZERO, | |
230 + GoldilocksField::ZERO, | |
231 + GoldilocksField::ZERO, | |
232 + ] | |
| | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree.rs:82:9 | |
| | |
82 | self.root_hash.clone() | |
| ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.root_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: use of `flat_map` with an identity function | |
--> core/src/merkle_tree/tree.rs:209:14 | |
| | |
209 | .flat_map(|e| e) | |
| ^^^^^^^^^^^^^^^ help: try: `flatten()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree.rs:218:33 | |
| | |
218 | .map(|metadata| metadata.root_hash.clone()) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `metadata.root_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree.rs:219:36 | |
| | |
219 | .unwrap_or_else(|| self.root_hash.clone()); | |
| ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.root_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree.rs:237:37 | |
| | |
237 | let root_hash = metadata.last().unwrap().root_hash.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `metadata.last().unwrap().root_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` | |
--> core/src/merkle_tree/tree.rs:271:18 | |
| | |
271 | .zip(op_idxs.clone().into_iter()) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `op_idxs.clone()` | |
| | |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` | |
--> /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:642:12 | |
| | |
642 | U: IntoIterator, | |
| ^^^^^^^^^^^^ | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
= note: `#[warn(clippy::useless_conversion)]` on by default | |
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` | |
--> core/src/merkle_tree/tree.rs:289:18 | |
| | |
289 | .zip(op_idxs.into_iter()) | |
| ^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `op_idxs` | |
| | |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` | |
--> /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:642:12 | |
| | |
642 | U: IntoIterator, | |
| ^^^^^^^^^^^^ | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree.rs:330:46 | |
| | |
330 | TreeOperation::Delete => default_leaf.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `default_leaf` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` | |
--> core/src/merkle_tree/tree.rs:361:22 | |
| | |
361 | .zip(self.storage.hashes(idxs.iter()).into_iter()) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `self.storage.hashes(idxs.iter())` | |
| | |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` | |
--> /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:642:12 | |
| | |
642 | U: IntoIterator, | |
| ^^^^^^^^^^^^ | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree.rs:421:43 | |
| | |
421 | merkle_paths.push(witness_hash.clone()); | |
| ^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*witness_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree.rs:426:33 | |
| | |
426 | let root_hash = branches.get(&(0, U256::zero()).into()).unwrap().clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*branches.get(&(0, U256::zero()).into()).unwrap()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree_config.rs:48:49 | |
| | |
48 | None => NodeEntry::Leaf { hash: hash.clone() }, | |
| ^^^^^^^^^^^^ help: try dereferencing it: `*hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree_config.rs:50:27 | |
| | |
50 | hash: hash.clone(), | |
| ^^^^^^^^^^^^ help: try dereferencing it: `*hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree_config.rs:51:32 | |
| | |
51 | left_hash: prev_hash.clone(), | |
| ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*prev_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> core/src/merkle_tree/tree_config.rs:52:33 | |
| | |
52 | right_hash: prev_hash.clone(), | |
| ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*prev_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: this loop could be written as a `for` loop | |
--> core/src/program/binary_program.rs:34:9 | |
| | |
34 | while let Some(instruction) = iter.next() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for instruction in iter` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator | |
= note: `#[warn(clippy::while_let_on_iterator)]` on by default | |
warning: called `unwrap` on `imm` after checking its variant with `is_some` | |
--> core/src/program/binary_program.rs:189:24 | |
| | |
188 | if imm.is_some() { | |
| ---------------- help: try: `if let Some(..) = imm` | |
189 | codes.push(imm.unwrap().hex); | |
| ^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap | |
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default | |
warning: called `unwrap` on `matched_op1_reg` after checking its variant with `is_some` | |
--> core/src/program/binary_program.rs:288:35 | |
| | |
286 | if matched_op1_reg.is_some() { | |
| ---------------------------- help: try: `if let Some(..) = matched_op1_reg` | |
287 | Some(OlaOperand::RegisterOperand { | |
288 | register: matched_op1_reg.unwrap(), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap | |
warning: useless use of `format!` | |
--> core/src/program/binary_program.rs:196:24 | |
| | |
196 | return Err(format!( | |
| ________________________^ | |
197 | | "decode binary instruction error, empty binary code." | |
198 | | )); | |
| |_____________^ help: consider using `.to_string()`: `"decode binary instruction error, empty binary code.".to_string()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format | |
= note: `#[warn(clippy::useless_format)]` on by default | |
warning: using `clone` on type `bool` which implements the `Copy` trait | |
--> core/src/program/binary_program.rs:219:36 | |
| | |
219 | .find(|(_op, matched)| matched.clone()) | |
| ^^^^^^^^^^^^^^^ help: try dereferencing it: `*matched` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `OlaOpcode` which implements the `Copy` trait | |
--> core/src/program/binary_program.rs:220:35 | |
| | |
220 | .map(|(op, _matched)| op.clone()); | |
| ^^^^^^^^^^ help: try dereferencing it: `*op` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `OlaOpcode` which implements the `Copy` trait | |
--> core/src/program/binary_program.rs:227:22 | |
| | |
227 | let opcode = matched_opcode.unwrap().clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `matched_opcode.unwrap()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `bool` which implements the `Copy` trait | |
--> core/src/program/binary_program.rs:257:37 | |
| | |
257 | .find(|(_reg, matched)| matched.clone()) | |
| ^^^^^^^^^^^^^^^ help: try dereferencing it: `*matched` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `OlaRegister` which implements the `Copy` trait | |
--> core/src/program/binary_program.rs:259:27 | |
| | |
259 | register: reg.clone(), | |
| ^^^^^^^^^^^ help: try dereferencing it: `*reg` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `bool` which implements the `Copy` trait | |
--> core/src/program/binary_program.rs:275:41 | |
| | |
275 | .find(|(_reg, matched)| matched.clone()) | |
| ^^^^^^^^^^^^^^^ help: try dereferencing it: `*matched` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `OlaRegister` which implements the `Copy` trait | |
--> core/src/program/binary_program.rs:276:40 | |
| | |
276 | .map(|(reg, _matched)| reg.clone()); | |
| ^^^^^^^^^^^ help: try dereferencing it: `*reg` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: useless use of `format!` | |
--> core/src/program/binary_program.rs:279:32 | |
| | |
279 | return Err(format!("")); | |
| ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format | |
warning: using `clone` on type `bool` which implements the `Copy` trait | |
--> core/src/program/binary_program.rs:308:37 | |
| | |
308 | .find(|(_reg, matched)| matched.clone()) | |
| ^^^^^^^^^^^^^^^ help: try dereferencing it: `*matched` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `OlaRegister` which implements the `Copy` trait | |
--> core/src/program/binary_program.rs:310:27 | |
| | |
310 | register: reg.clone(), | |
| ^^^^^^^^^^^ help: try dereferencing it: `*reg` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: useless use of `format!` | |
--> core/src/program/binary_program.rs:382:17 | |
| | |
382 | format!("{}", self.opcode.token()) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.opcode.token().to_string()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format | |
warning: useless use of `format!` | |
--> core/src/program/binary_program.rs:403:30 | |
| | |
403 | Some(prophet) => format!("{}", prophet.code), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `prophet.code.to_string()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format | |
warning: unneeded `return` statement | |
--> core/src/program/decoder.rs:17:5 | |
| | |
17 | return decode_binary_program_to_instructions(program); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
17 - return decode_binary_program_to_instructions(program); | |
17 + decode_binary_program_to_instructions(program) | |
| | |
warning: useless use of `format!` | |
--> core/src/program/decoder.rs:13:20 | |
| | |
13 | return Err(format!("{}", program_res.err().unwrap().to_string())); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `program_res.err().unwrap().to_string()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format | |
warning: `to_string` applied to a type that implements `Display` in `format!` args | |
--> core/src/program/decoder.rs:13:60 | |
| | |
13 | return Err(format!("{}", program_res.err().unwrap().to_string())); | |
| ^^^^^^^^^^^^ help: remove this | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args | |
= note: `#[warn(clippy::to_string_in_format_args)]` on by default | |
warning: this loop could be written as a `while let` loop | |
--> core/src/program/decoder.rs:32:5 | |
| | |
32 | / loop { | |
33 | | if let Some(line) = lines.next() { | |
34 | | if !cached_first_instruction.is_empty() { | |
35 | | cached_first_instruction.push(line.to_string()); | |
... | | |
55 | | } | |
56 | | } | |
| |_____^ help: try: `while let Some(line) = lines.next() { .. }` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop | |
= note: `#[warn(clippy::while_let_loop)]` on by default | |
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do | |
--> core/src/state/state_storage.rs:33:22 | |
| | |
33 | code_hashes: &Vec<TreeValue>, | |
| ^^^^^^^^^^^^^^^ help: change this to: `&[TreeValue]` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg | |
warning: called `unwrap` on `res` after checking its variant with `is_some` | |
--> core/src/state/state_storage.rs:71:27 | |
| | |
70 | if res.is_some() { | |
| ---------------- help: try: `if let Some(..) = res` | |
71 | return Ok(res.unwrap()); | |
| ^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap | |
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do | |
--> core/src/state/state_storage.rs:82:22 | |
| | |
82 | code_hashes: &Vec<TreeValue>, | |
| ^^^^^^^^^^^^^^^ help: change this to: `&[TreeValue]` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg | |
warning: unneeded `return` statement | |
--> core/src/state/state_storage.rs:113:13 | |
| | |
113 | return Ok(u8_arr_to_field_arr(&code.unwrap())); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
113 - return Ok(u8_arr_to_field_arr(&code.unwrap())); | |
113 + Ok(u8_arr_to_field_arr(&code.unwrap())) | |
| | |
warning: unneeded `return` statement | |
--> core/src/state/state_storage.rs:115:13 | |
| | |
115 | return Err(StateError::StorageIoError(res.err().unwrap())); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
115 - return Err(StateError::StorageIoError(res.err().unwrap())); | |
115 + Err(StateError::StorageIoError(res.err().unwrap())) | |
| | |
warning: unneeded `return` statement | |
--> core/src/state/state_storage.rs:140:13 | |
| | |
140 | return Ok(code.unwrap()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
140 - return Ok(code.unwrap()); | |
140 + Ok(code.unwrap()) | |
| | |
warning: unneeded `return` statement | |
--> core/src/state/state_storage.rs:142:13 | |
| | |
142 | return Err(StateError::StorageIoError(res.err().unwrap())); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
142 - return Err(StateError::StorageIoError(res.err().unwrap())); | |
142 + Err(StateError::StorageIoError(res.err().unwrap())) | |
| | |
warning: unneeded `return` statement | |
--> core/src/state/state_storage.rs:180:13 | |
| | |
180 | return Ok(String::from_utf8(code).unwrap()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
180 - return Ok(String::from_utf8(code).unwrap()); | |
180 + Ok(String::from_utf8(code).unwrap()) | |
| | |
warning: unneeded `return` statement | |
--> core/src/state/state_storage.rs:182:13 | |
| | |
182 | return Err(StateError::StorageIoError(res.err().unwrap())); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
182 - return Err(StateError::StorageIoError(res.err().unwrap())); | |
182 + Err(StateError::StorageIoError(res.err().unwrap())) | |
| | |
warning: unneeded `return` statement | |
--> core/src/state/state_storage.rs:194:13 | |
| | |
194 | return Ok(String::from_utf8(code).unwrap()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
194 - return Ok(String::from_utf8(code).unwrap()); | |
194 + Ok(String::from_utf8(code).unwrap()) | |
| | |
warning: unneeded `return` statement | |
--> core/src/state/state_storage.rs:196:13 | |
| | |
196 | return Err(StateError::StorageIoError(res.err().unwrap())); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
196 - return Err(StateError::StorageIoError(res.err().unwrap())); | |
196 + Err(StateError::StorageIoError(res.err().unwrap())) | |
| | |
warning: unneeded `return` statement | |
--> core/src/state/mod.rs:48:9 | |
| | |
48 | return Ok(code_hashes); | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
48 - return Ok(code_hashes); | |
48 + Ok(code_hashes) | |
| | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/state/mod.rs:44:53 | |
| | |
44 | code_hashes.push(self.hasher.hash_bytes(&code)); | |
| ^^^^^ help: change this to: `code` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/state/mod.rs:47:43 | |
| | |
47 | .save_contracts(&code_hashes, &contracts)?; | |
| ^^^^^^^^^^ help: change this to: `contracts` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: unneeded `return` statement | |
--> core/src/state/mod.rs:57:9 | |
| | |
57 | return Ok(code_hash); | |
| ^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
57 - return Ok(code_hash); | |
57 + Ok(code_hash) | |
| | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/state/mod.rs:55:48 | |
| | |
55 | let code_hash = self.hasher.hash_bytes(&contract); | |
| ^^^^^^^^^ help: change this to: `contract` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/state/mod.rs:56:54 | |
| | |
56 | self.state_storage.save_contract(&code_hash, &contract)?; | |
| ^^^^^^^^^ help: change this to: `contract` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/state/mod.rs:65:41 | |
| | |
65 | self.state_storage.save_program(&code_hash, &contract)?; | |
| ^^^^^^^^^^ help: change this to: `code_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/state/mod.rs:65:53 | |
| | |
65 | self.state_storage.save_program(&code_hash, &contract)?; | |
| ^^^^^^^^^ help: change this to: `contract` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: unneeded `return` statement | |
--> core/src/state/mod.rs:82:9 | |
| | |
82 | return Ok(()); | |
| ^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
82 - return Ok(()); | |
82 + Ok(()) | |
| | |
warning: unneeded `return` statement | |
--> core/src/state/mod.rs:91:9 | |
| | |
91 | return Ok(()); | |
| ^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
91 - return Ok(()); | |
91 + Ok(()) | |
| | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/state/mod.rs:111:46 | |
| | |
111 | self.state_storage.save_contract_map(&contract, &code_hash) | |
| ^^^^^^^^^ help: change this to: `contract` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/state/mod.rs:111:57 | |
| | |
111 | self.state_storage.save_contract_map(&contract, &code_hash) | |
| ^^^^^^^^^^ help: change this to: `code_hash` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/state/mod.rs:115:45 | |
| | |
115 | self.state_storage.get_contract_map(&contract) | |
| ^^^^^^^^^ help: change this to: `contract` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> core/src/state/mod.rs:120:27 | |
| | |
120 | trace.tape.extend(std::mem::replace( | |
| ___________________________^ | |
121 | | &mut self.txs_trace.get_mut(&0).unwrap().tape, | |
122 | | Vec::new(), | |
123 | | )); | |
| |_________^ help: consider using: `std::mem::take(&mut self.txs_trace.get_mut(&0).unwrap().tape)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
= note: `#[warn(clippy::mem_replace_with_default)]` on by default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> core/src/state/mod.rs:124:27 | |
| | |
124 | trace.exec.extend(std::mem::replace( | |
| ___________________________^ | |
125 | | &mut self.txs_trace.get_mut(&0).unwrap().exec, | |
126 | | Vec::new(), | |
127 | | )); | |
| |_________^ help: consider using: `std::mem::take(&mut self.txs_trace.get_mut(&0).unwrap().exec)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> core/src/state/mod.rs:128:43 | |
| | |
128 | trace.builtin_storage_hash.extend(std::mem::replace( | |
| ___________________________________________^ | |
129 | | &mut self.txs_trace.get_mut(&0).unwrap().builtin_storage_hash, | |
130 | | Vec::new(), | |
131 | | )); | |
| |_________^ help: consider using: `std::mem::take(&mut self.txs_trace.get_mut(&0).unwrap().builtin_storage_hash)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> core/src/state/mod.rs:132:43 | |
| | |
132 | trace.builtin_program_hash.extend(std::mem::replace( | |
| ___________________________________________^ | |
133 | | &mut self.txs_trace.get_mut(&0).unwrap().builtin_program_hash, | |
134 | | Vec::new(), | |
135 | | )); | |
| |_________^ help: consider using: `std::mem::take(&mut self.txs_trace.get_mut(&0).unwrap().builtin_program_hash)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> core/src/state/mod.rs:137:26 | |
| | |
137 | trace.ret.extend(std::mem::replace( | |
| __________________________^ | |
138 | | &mut self.txs_trace.get_mut(&0).unwrap().ret, | |
139 | | Vec::new(), | |
140 | | )); | |
| |_________^ help: consider using: `std::mem::take(&mut self.txs_trace.get_mut(&0).unwrap().ret)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: module has the same name as its containing module | |
--> core/src/trace/mod.rs:2:1 | |
| | |
2 | pub mod trace; | |
| ^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception | |
= note: `#[warn(clippy::module_inception)]` on by default | |
warning: this function has too many arguments (18/7) | |
--> core/src/trace/trace.rs:427:5 | |
| | |
427 | / pub fn insert_step( | |
428 | | &mut self, | |
429 | | clk: u32, | |
430 | | pc: u64, | |
... | | |
445 | | storage_access_idx: GoldilocksField, | |
446 | | ) { | |
| |_____^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
= note: `#[warn(clippy::too_many_arguments)]` on by default | |
warning: this function has too many arguments (8/7) | |
--> core/src/trace/trace.rs:469:5 | |
| | |
469 | / pub fn insert_storage( | |
470 | | &mut self, | |
471 | | clk: u32, | |
472 | | diff_clk: u32, | |
... | | |
477 | | env_idx: GoldilocksField, | |
478 | | ) { | |
| |_____^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: this function has too many arguments (10/7) | |
--> core/src/trace/trace.rs:490:5 | |
| | |
490 | / pub fn insert_sccall( | |
491 | | &mut self, | |
492 | | caller_env_idx: GoldilocksField, | |
493 | | addr_storage: Address, | |
... | | |
500 | | clk_callee_end: GoldilocksField, | |
501 | | ) { | |
| |_____^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: this function has too many arguments (12/7) | |
--> core/src/trace/trace.rs:515:5 | |
| | |
515 | / pub fn insert_poseidon_chunk( | |
516 | | &mut self, | |
517 | | env_idx: GoldilocksField, | |
518 | | clk: u32, | |
... | | |
527 | | is_ext_line: GoldilocksField, | |
528 | | ) { | |
| |_____^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: you are using an explicit closure for copying elements | |
--> core/src/types/merkle_tree/mod.rs:162:21 | |
| | |
162 | chunk.map(|e| *e).collect::<Vec<_>>().try_into().unwrap(), | |
| ^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `chunk.copied()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone | |
= note: `#[warn(clippy::map_clone)]` on by default | |
warning: useless conversion to the same type: `([plonky2::plonky2_field::goldilocks_field::GoldilocksField; 4], trace::trace::PoseidonRow)` | |
--> core/src/types/storage/mod.rs:49:9 | |
| | |
49 | Self::raw_hashed_key(self.address(), self.key()).into() | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `Self::raw_hashed_key(self.address(), self.key())` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do | |
--> core/src/types/storage/mod.rs:53:35 | |
| | |
53 | pub fn field_arr_to_u8_arr(value: &Vec<GoldilocksField>) -> Vec<u8> { | |
| ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[GoldilocksField]` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg | |
warning: you are using an explicit closure for copying elements | |
--> core/src/types/storage/mod.rs:73:17 | |
| | |
73 | chunk.map(|e| *e).collect::<Vec<_>>().try_into().unwrap(), | |
| ^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `chunk.copied()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone | |
warning: the loop variable `i` is only used to index `state` | |
--> core/src/util/poseidon_utils.rs:303:14 | |
| | |
303 | for i in 0..POSEIDON_STATE_WIDTH { | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
= note: `#[warn(clippy::needless_range_loop)]` on by default | |
help: consider using an iterator | |
| | |
303 | for <item> in state.iter_mut().take(POSEIDON_STATE_WIDTH) { | |
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: the loop variable `i` is used to index `res` | |
--> core/src/util/poseidon_utils.rs:322:14 | |
| | |
322 | for i in 0..POSEIDON_STATE_WIDTH { | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator and enumerate() | |
| | |
322 | for (i, <item>) in res.iter_mut().enumerate().take(POSEIDON_STATE_WIDTH) { | |
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> core/src/util/poseidon_utils.rs:323:39 | |
| | |
323 | res[i] = mds_row_shf_field(i, &state); | |
| ^^^^^^ help: change this to: `state` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: the loop variable `i` is used to index `state` | |
--> core/src/util/poseidon_utils.rs:329:14 | |
| | |
329 | for i in 0..12 { | |
| ^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator and enumerate() | |
| | |
329 | for (i, <item>) in state.iter_mut().enumerate().take(12) { | |
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: the loop variable `r` is used to index `state` | |
--> core/src/util/poseidon_utils.rs:343:14 | |
| | |
343 | for r in 1..12 { | |
| ^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator and enumerate() | |
| | |
343 | for (r, <item>) in state.iter().enumerate().take(12).skip(1) { | |
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: the loop variable `c` is used to index `result` | |
--> core/src/util/poseidon_utils.rs:345:22 | |
| | |
345 | for c in 1..12 { | |
| ^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator and enumerate() | |
| | |
345 | for (c, <item>) in result.iter_mut().enumerate().skip(1) { | |
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: the loop variable `i` is used to index `state` | |
--> core/src/util/poseidon_utils.rs:365:14 | |
| | |
365 | for i in 1..POSEIDON_STATE_WIDTH { | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator and enumerate() | |
| | |
365 | for (i, <item>) in state.iter().enumerate().take(POSEIDON_STATE_WIDTH).skip(1) { | |
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: this function has too many arguments (10/7) | |
--> core/src/vm/memory.rs:33:5 | |
| | |
33 | / pub fn read( | |
34 | | &mut self, | |
35 | | addr: u64, | |
36 | | clk: u32, | |
... | | |
43 | | env_idx: GoldilocksField, | |
44 | | ) -> Result<GoldilocksField, ProcessorError> { | |
| |________________________________________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: this function has too many arguments (11/7) | |
--> core/src/vm/memory.rs:70:5 | |
| | |
70 | / pub fn write( | |
71 | | &mut self, | |
72 | | addr: u64, | |
73 | | clk: u32, | |
... | | |
81 | | env_idx: GoldilocksField, | |
82 | | ) { | |
| |_____^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: called `unwrap` on `special_reg` after checking its variant with `is_ok` | |
--> core/src/vm/operands.rs:87:30 | |
| | |
85 | if special_reg.is_ok() { | |
| ---------------------- help: try: `if let Ok(..) = special_reg` | |
86 | return Ok(OlaOperand::SpecialReg { | |
87 | special_reg: special_reg.unwrap(), | |
| ^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap | |
warning: unneeded `return` statement | |
--> core/src/vm/operands.rs:91:9 | |
| | |
91 | return Err(format!("invalid operand: {}", s)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
91 - return Err(format!("invalid operand: {}", s)); | |
91 + Err(format!("invalid operand: {}", s)) | |
| | |
warning: unneeded `return` statement | |
--> core/src/vm/operands.rs:136:9 | |
| | |
136 | return u64::from_str_radix(without_prefix, 16); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
136 - return u64::from_str_radix(without_prefix, 16); | |
136 + u64::from_str_radix(without_prefix, 16) | |
| | |
warning: this call to `from_str_radix` can be replaced with a call to `str::parse` | |
--> core/src/vm/operands.rs:167:29 | |
| | |
167 | let parsed_result = i128::from_str_radix(s, 10); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `s.parse::<i128>()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 | |
= note: `#[warn(clippy::from_str_radix_10)]` on by default | |
warning: this multiplication by -1 can be written more succinctly | |
--> core/src/vm/operands.rs:173:37 | |
| | |
173 | if value >= signed_order || value * -1 >= signed_order { | |
| ^^^^^^^^^^ help: consider using: `-value` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply | |
= note: `#[warn(clippy::neg_multiply)]` on by default | |
warning: large size difference between variants | |
--> core/src/vm/vm_state.rs:12:1 | |
| | |
12 | / pub enum VMState { | |
13 | | ExeEnd(Option<Step>), | |
| | -------------------- the largest variant contains at least 536 bytes | |
14 | | SCCall(SCCallType), | |
| | ------------------ the second-largest variant contains at least 40 bytes | |
15 | | } | |
| |_^ the entire enum is at least 536 bytes | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant | |
= note: `#[warn(clippy::large_enum_variant)]` on by default | |
help: consider boxing the large fields to reduce the total size of the enum | |
| | |
13 | ExeEnd(Box<Option<Step>>), | |
| ~~~~~~~~~~~~~~~~~ | |
warning: `core` (lib) generated 110 warnings (run `cargo clippy --fix --lib -p core` to apply 84 suggestions) | |
warning: unused import: `info` | |
--> interpreter/src/interpreter/executor.rs:21:18 | |
| | |
21 | use log::{debug, info}; | |
| ^^^^ | |
| | |
= note: `#[warn(unused_imports)]` on by default | |
warning: this `else { if .. }` block can be collapsed | |
--> interpreter/src/parser/mod.rs:122:20 | |
| | |
122 | } else { | |
| ____________________^ | |
123 | | if self.get_current_token() == Comma { | |
124 | | self.consume(&Comma); | |
125 | | } | |
126 | | } | |
| |_____________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if | |
= note: `#[warn(clippy::collapsible_else_if)]` on by default | |
help: collapse nested if block | |
| | |
122 ~ } else if self.get_current_token() == Comma { | |
123 + self.consume(&Comma); | |
124 + } | |
| | |
warning: this `else { if .. }` block can be collapsed | |
--> interpreter/src/sema/mod.rs:233:20 | |
| | |
233 | } else { | |
| ____________________^ | |
234 | | if let Some(IdentSymbol(_ident, BuiltIn(token), size)) = ident { | |
235 | | array_id!(name, node, size, IdentNode); | |
236 | | if size.is_some() { | |
... | | |
242 | | } | |
243 | | } | |
| |_____________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if | |
help: collapse nested if block | |
| | |
233 ~ } else if let Some(IdentSymbol(_ident, BuiltIn(token), size)) = ident { | |
234 + array_id!(name, node, size, IdentNode); | |
235 + if size.is_some() { | |
236 + return Ok(Single(number_from_token(&token, size.unwrap()))); | |
237 + } | |
238 + Ok(Single(Number::from(&token))) | |
239 + } else { | |
240 + panic!("ident not support symbol type") | |
241 + } | |
| | |
warning: this `else { if .. }` block can be collapsed | |
--> interpreter/src/sema/mod.rs:394:24 | |
| | |
394 | } else { | |
| ________________________^ | |
395 | | if let IdentSymbol(name, BuiltIn(_token), size) = | |
396 | | self.current_scope.read().unwrap().lookup(&name).unwrap() | |
397 | | { | |
398 | | array_id!(name, ident, size, IdentNode); | |
399 | | } | |
400 | | } | |
| |_________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if | |
help: collapse nested if block | |
| | |
394 ~ } else if let IdentSymbol(name, BuiltIn(_token), size) = | |
395 + self.current_scope.read().unwrap().lookup(&name).unwrap() | |
396 + { | |
397 + array_id!(name, ident, size, IdentNode); | |
398 + } | |
| | |
warning: unneeded `return` statement | |
--> interpreter/src/interpreter/executor.rs:95:9 | |
| | |
95 | / return CallStack { | |
96 | | records: Vec::new(), | |
97 | | }; | |
| |_________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
= note: `#[warn(clippy::needless_return)]` on by default | |
help: remove `return` | |
| | |
95 ~ CallStack { | |
96 + records: Vec::new(), | |
97 ~ } | |
| | |
warning: casting to the same type is unnecessary (`u64` -> `u64`) | |
--> interpreter/src/interpreter/executor.rs:147:57 | |
| | |
147 | .insert(name.clone(), Some(Number::from((*value) as u64))); | |
| ^^^^^^^^^^^^^^^ help: try: `(*value)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast | |
= note: `#[warn(clippy::unnecessary_cast)]` on by default | |
warning: unneeded `return` statement | |
--> interpreter/src/interpreter/executor.rs:286:13 | |
| | |
286 | return true; | |
| ^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
286 - return true; | |
286 + true | |
| | |
warning: this `if let` can be collapsed into the outer `if let` | |
--> interpreter/src/interpreter/executor.rs:310:17 | |
| | |
310 | / if let Some(value) = value { | |
311 | | out_values.extend(value.clone()); | |
312 | | } | |
| |_________________^ | |
| | |
help: the outer pattern can be modified to include the inner pattern | |
--> interpreter/src/interpreter/executor.rs:306:32 | |
| | |
306 | } else if let Some(value) = self.call_stack.records[GLOBAL_LEVEL] | |
| ^^^^^ replace this binding | |
... | |
310 | if let Some(value) = value { | |
| ^^^^^^^^^^^ with this pattern | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match | |
= note: `#[warn(clippy::collapsible_match)]` on by default | |
warning: this `if let` can be collapsed into the outer `if let` | |
--> interpreter/src/interpreter/executor.rs:323:17 | |
| | |
323 | / if let Some(value) = value { | |
324 | | out_values.extend(value.clone()); | |
325 | | } | |
| |_________________^ | |
| | |
help: the outer pattern can be modified to include the inner pattern | |
--> interpreter/src/interpreter/executor.rs:321:32 | |
| | |
321 | } else if let Some(value) = self.call_stack.records[GLOBAL_LEVEL].array_idents.get(ctx) | |
| ^^^^^ replace this binding | |
322 | { | |
323 | if let Some(value) = value { | |
| ^^^^^^^^^^^ with this pattern | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/interpreter/executor.rs:352:31 | |
| | |
352 | ret = self.travel(&block); | |
| ^^^^^^ help: change this to: `block` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
= note: `#[warn(clippy::needless_borrow)]` on by default | |
warning: returning the result of a `let` binding from a block | |
--> interpreter/src/interpreter/executor.rs:364:9 | |
| | |
363 | let res = self.travel(&node.compound_statement); | |
| ------------------------------------------------ unnecessary `let` binding | |
364 | res | |
| ^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
= note: `#[warn(clippy::let_and_return)]` on by default | |
help: return the expression directly | |
| | |
363 ~ | |
364 ~ self.travel(&node.compound_statement) | |
| | |
warning: binary comparison to literal `Option::None` | |
--> interpreter/src/interpreter/executor.rs:392:20 | |
| | |
392 | if self.call_stack.records[self.stack_depth] | |
| ____________________^ | |
393 | | .array_idents | |
394 | | .get(name) | |
395 | | != None | |
| |___________________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none | |
= note: `#[warn(clippy::partialeq_to_none)]` on by default | |
help: use `Option::is_some()` instead | |
| | |
392 ~ if self.call_stack.records[self.stack_depth] | |
393 + .array_idents | |
394 + .get(name).is_some() | |
| | |
warning: binary comparison to literal `Option::None` | |
--> interpreter/src/interpreter/executor.rs:409:16 | |
| | |
409 | if self.call_stack.records[self.stack_depth].idents.get(name) != None { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `self.call_stack.records[self.stack_depth].idents.get(name).is_some()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none | |
warning: unneeded `return` statement | |
--> interpreter/src/interpreter/executor.rs:489:9 | |
| | |
489 | return Ok(Single(ret)); | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
489 - return Ok(Single(ret)); | |
489 + Ok(Single(ret)) | |
| | |
warning: equality checks against true are unnecessary | |
--> interpreter/src/interpreter/executor.rs:554:16 | |
| | |
554 | if flag == true { | |
| ^^^^^^^^^^^^ help: try simplifying it as shown: `flag` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison | |
= note: `#[warn(clippy::bool_comparison)]` on by default | |
warning: equality checks against true are unnecessary | |
--> interpreter/src/interpreter/executor.rs:577:20 | |
| | |
577 | if flag == true { | |
| ^^^^^^^^^^^^ help: try simplifying it as shown: `flag` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison | |
warning: returning the result of a `let` binding from a block | |
--> interpreter/src/interpreter/executor.rs:604:13 | |
| | |
600 | / let res = match value { | |
601 | | Number::Felt(number) => Ok(Single(Number::Felt((number as f64).sqrt() as i128))), | |
602 | | _ => panic!("wrong sqrt value type"), | |
603 | | }; | |
| |______________- unnecessary `let` binding | |
604 | res | |
| ^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
help: return the expression directly | |
| | |
600 ~ | |
601 ~ match value { | |
602 + Number::Felt(number) => Ok(Single(Number::Felt((number as f64).sqrt() as i128))), | |
603 + _ => panic!("wrong sqrt value type"), | |
604 + } | |
| | |
warning: length comparison to zero | |
--> interpreter/src/interpreter/executor.rs:612:12 | |
| | |
612 | if node.returns.len() > 0 { | |
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!node.returns.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
= note: `#[warn(clippy::len_zero)]` on by default | |
warning: the method `travel` doesn't need a mutable reference | |
--> interpreter/src/interpreter/executor.rs:615:39 | |
| | |
615 | let res = self.travel(&mut node)?; | |
| ^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed | |
= note: `#[warn(clippy::unnecessary_mut_passed)]` on by default | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/interpreter/executor.rs:615:39 | |
| | |
615 | let res = self.travel(&mut node)?; | |
| ^^^^^^^^^ help: change this to: `node` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/interpreter/executor.rs:643:29 | |
| | |
643 | self.travel(&ident_node)?; | |
| ^^^^^^^^^^^ help: change this to: `ident_node` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/interpreter/mod.rs:19:38 | |
| | |
19 | let mut parser = Parser::new(&text); | |
| ^^^^^ help: change this to: `text` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/interpreter/mod.rs:34:45 | |
| | |
34 | .traverse(&mut SymTableGen::new(&prophet))?; | |
| ^^^^^^^^ help: change this to: `prophet` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/interpreter/mod.rs:36:37 | |
| | |
36 | let mut exe = Executor::new(&prophet, values, mem); | |
| ^^^^^^^^ help: change this to: `prophet` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this lifetime isn't used in the impl | |
--> interpreter/src/lexer/token.rs:60:6 | |
| | |
60 | impl<'a> fmt::Display for Token { | |
| ^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes | |
= note: `#[warn(clippy::extra_unused_lifetimes)]` on by default | |
warning: binary comparison to literal `Option::None` | |
--> interpreter/src/lexer/mod.rs:72:15 | |
| | |
72 | while self.current_char != None && self.current_char.unwrap().is_whitespace() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `self.current_char.is_some()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none | |
warning: binary comparison to literal `Option::None` | |
--> interpreter/src/lexer/mod.rs:79:15 | |
| | |
79 | while self.current_char != None && self.current_char.unwrap().is_alphanumeric() | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `self.current_char.is_some()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none | |
warning: binary comparison to literal `Option::None` | |
--> interpreter/src/lexer/mod.rs:98:15 | |
| | |
98 | while self.current_char != None && self.current_char.unwrap().is_digit(10) { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `self.current_char.is_some()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none | |
warning: use of `char::is_digit` with literal radix of 10 | |
--> interpreter/src/lexer/mod.rs:98:44 | |
| | |
98 | while self.current_char != None && self.current_char.unwrap().is_digit(10) { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.current_char.unwrap().is_ascii_digit()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix | |
= note: `#[warn(clippy::is_digit_ascii_radix)]` on by default | |
warning: binary comparison to literal `Option::None` | |
--> interpreter/src/lexer/mod.rs:112:15 | |
| | |
112 | while self.current_char != None { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `self.current_char.is_some()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none | |
warning: use of `char::is_digit` with literal radix of 10 | |
--> interpreter/src/lexer/mod.rs:156:25 | |
| | |
156 | char if char.is_digit(10) => self.number(), | |
| ^^^^^^^^^^^^^^^^^ help: try: `char.is_ascii_digit()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/parser/node.rs:93:23 | |
| | |
93 | to_string(&left), | |
| ^^^^^ help: change this to: `left` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/parser/node.rs:94:23 | |
| | |
94 | to_string(&right), | |
| ^^^^^^ help: change this to: `right` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/parser/mod.rs:44:36 | |
| | |
44 | let mut lexer = Lexer::new(&text); | |
| ^^^^^ help: change this to: `text` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:77:9 | |
| | |
77 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<EntryNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<EntryNode>` | |
= note: required for `Arc<RwLock<EntryNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
= note: `#[warn(clippy::arc_with_non_send_sync)]` on by default | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:106:35 | |
| | |
106 | declarations.push(Arc::new(RwLock::new(node))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<IdentDeclarationNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<IdentDeclarationNode>` | |
= note: required for `Arc<RwLock<IdentDeclarationNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/parser/mod.rs:111:60 | |
| | |
111 | declarations.extend(self.ident_declaration(&type_node)); | |
| ^^^^^^^^^^ help: change this to: `type_node` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: unneeded late initialization | |
--> interpreter/src/parser/mod.rs:26:9 | |
| | |
26 | / $len = match $v.get_current_token() { | |
27 | | FeltConst(num) => num, | |
28 | | I32Const(num) => num, | |
29 | | _ => panic!("not support token type for declare"), | |
30 | | }; | |
| |_________^ initialised here | |
... | |
163 | let len; | |
| ^^^^^^^^ created here | |
164 | array_type_node!(self, len); | |
| --------------------------- in this macro invocation | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init | |
= note: `#[warn(clippy::needless_late_init)]` on by default | |
= note: this warning originates in the macro `array_type_node` (in Nightly builds, run with -Z macro-backtrace for more info) | |
help: declare `len` here | |
| | |
164 | array_type_node!(self, let len); | |
| ~~~~~~~ | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:168:50 | |
| | |
168 | ... returns.push(Arc::new(RwLock::new(node))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<TypeNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<TypeNode>` | |
= note: required for `Arc<RwLock<TypeNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:170:50 | |
| | |
170 | ... returns.push(Arc::new(RwLock::new(type_node))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<TypeNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<TypeNode>` | |
= note: required for `Arc<RwLock<TypeNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: unneeded late initialization | |
--> interpreter/src/parser/mod.rs:26:9 | |
| | |
26 | / $len = match $v.get_current_token() { | |
27 | | FeltConst(num) => num, | |
28 | | I32Const(num) => num, | |
29 | | _ => panic!("not support token type for declare"), | |
30 | | }; | |
| |_________^ initialised here | |
... | |
180 | let len; | |
| ^^^^^^^^ created here | |
181 | array_type_node!(self, len); | |
| --------------------------- in this macro invocation | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init | |
= note: this warning originates in the macro `array_type_node` (in Nightly builds, run with -Z macro-backtrace for more info) | |
help: declare `len` here | |
| | |
181 | array_type_node!(self, let len); | |
| ~~~~~~~ | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:184:46 | |
| | |
184 | ... returns.push(Arc::new(RwLock::new(node))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<TypeNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<TypeNode>` | |
= note: required for `Arc<RwLock<TypeNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:186:46 | |
| | |
186 | ... returns.push(Arc::new(RwLock::new(type_node))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<TypeNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<TypeNode>` | |
= note: required for `Arc<RwLock<TypeNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:195:39 | |
| | |
195 | declarations.push(Arc::new(RwLock::new(node))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<FunctionNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<FunctionNode>` | |
= note: required for `Arc<RwLock<FunctionNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:214:9 | |
| | |
214 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<EntryBlockNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<EntryBlockNode>` | |
= note: required for `Arc<RwLock<EntryBlockNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:224:9 | |
| | |
224 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<BlockNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<BlockNode>` | |
= note: required for `Arc<RwLock<BlockNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:231:9 | |
| | |
231 | Arc::new(RwLock::new(CompoundNode::new(nodes))) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<CompoundNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<CompoundNode>` | |
= note: required for `Arc<RwLock<CompoundNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:298:30 | |
| | |
298 | results.push(Arc::new(RwLock::new(node))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<ReturnNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<ReturnNode>` | |
= note: required for `Arc<RwLock<ReturnNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:310:37 | |
| | |
310 | idents.push(Arc::new(RwLock::new(IdentNode::new( | |
| _____________________________________^ | |
311 | | self.get_current_token(), | |
312 | | )))); | |
| |___________________________^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<IdentNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<IdentNode>` | |
= note: required for `Arc<RwLock<IdentNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:324:34 | |
| | |
324 | results.push(Arc::new(RwLock::new(node))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<MultiAssignNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<MultiAssignNode>` | |
= note: required for `Arc<RwLock<MultiAssignNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:336:30 | |
| | |
336 | results.push(Arc::new(RwLock::new(PrintfNode::new(start, flag)))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<PrintfNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<PrintfNode>` | |
= note: required for `Arc<RwLock<PrintfNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:367:36 | |
| | |
367 | declaration_nodes.push(Arc::new(RwLock::new(declaration))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<IdentDeclarationNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<IdentDeclarationNode>` | |
= note: required for `Arc<RwLock<IdentDeclarationNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:400:9 | |
| | |
400 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<CallNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<CallNode>` | |
= note: required for `Arc<RwLock<CallNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:416:13 | |
| | |
416 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<AssignNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<AssignNode>` | |
= note: required for `Arc<RwLock<AssignNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: unneeded `return` statement | |
--> interpreter/src/parser/mod.rs:447:9 | |
| | |
447 | return Arc::new(RwLock::new(node)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
447 - return Arc::new(RwLock::new(node)); | |
447 + Arc::new(RwLock::new(node)) | |
| | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:447:16 | |
| | |
447 | return Arc::new(RwLock::new(node)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<CondStatNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<CondStatNode>` | |
= note: required for `Arc<RwLock<CondStatNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:460:9 | |
| | |
460 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<LoopStatNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<LoopStatNode>` | |
= note: required for `Arc<RwLock<LoopStatNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:479:17 | |
| | |
479 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<CallNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<CallNode>` | |
= note: required for `Arc<RwLock<CallNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:485:17 | |
| | |
485 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<IdentIndexNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<IdentIndexNode>` | |
= note: required for `Arc<RwLock<IdentIndexNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:488:17 | |
| | |
488 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<IdentNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<IdentNode>` | |
= note: required for `Arc<RwLock<IdentNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:493:13 | |
| | |
493 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<ContextIdentNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<ContextIdentNode>` | |
= note: required for `Arc<RwLock<ContextIdentNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:506:17 | |
| | |
506 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<UnaryOpNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<UnaryOpNode>` | |
= note: required for `Arc<RwLock<UnaryOpNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:525:17 | |
| | |
525 | Arc::new(RwLock::new(SqrtNode::new(sqrt_value))) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<SqrtNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<SqrtNode>` | |
= note: required for `Arc<RwLock<SqrtNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:532:17 | |
| | |
532 | Arc::new(RwLock::new(MallocNode::new(num_bytes))) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<MallocNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<MallocNode>` | |
= note: required for `Arc<RwLock<MallocNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:549:17 | |
| | |
549 | Arc::new(RwLock::new(PrintfNode::new(start, flag))) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<PrintfNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<PrintfNode>` | |
= note: required for `Arc<RwLock<PrintfNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:565:20 | |
| | |
565 | node = Arc::new(RwLock::new(BinOpNode::new( | |
| ____________________^ | |
566 | | node, | |
567 | | self.cast_expr(), | |
568 | | current_token, | |
569 | | ))); | |
| |_______________^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<BinOpNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<BinOpNode>` | |
= note: required for `Arc<RwLock<BinOpNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:580:20 | |
| | |
580 | node = Arc::new(RwLock::new(BinOpNode::new( | |
| ____________________^ | |
581 | | node, | |
582 | | self.mul_expr(), | |
583 | | current_token, | |
584 | | ))); | |
| |_______________^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<BinOpNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<BinOpNode>` | |
= note: required for `Arc<RwLock<BinOpNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:603:13 | |
| | |
603 | Arc::new(RwLock::new(node)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<BinOpNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<BinOpNode>` | |
= note: required for `Arc<RwLock<BinOpNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:614:20 | |
| | |
614 | node = Arc::new(RwLock::new(BinOpNode::new( | |
| ____________________^ | |
615 | | node, | |
616 | | self.rel_expr(), | |
617 | | current_token, | |
618 | | ))); | |
| |_______________^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<BinOpNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<BinOpNode>` | |
= note: required for `Arc<RwLock<BinOpNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/parser/mod.rs:629:20 | |
| | |
629 | node = Arc::new(RwLock::new(BinOpNode::new( | |
| ____________________^ | |
630 | | node, | |
631 | | self.and_expr(), | |
632 | | current_token, | |
633 | | ))); | |
| |_______________^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<BinOpNode>` | |
= note: the trait `Sync` is not implemented for `RwLock<BinOpNode>` | |
= note: required for `Arc<RwLock<BinOpNode>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: called `unwrap` on `symbol` after checking its variant with `is_some` | |
--> interpreter/src/sema/symbol.rs:60:13 | |
| | |
59 | if symbol.is_some() { | |
| ------------------- help: try: `if let Some(..) = symbol` | |
60 | symbol.unwrap() | |
| ^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap | |
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default | |
warning: use of `println!` in `Display` impl | |
--> interpreter/src/sema/symbol.rs:122:9 | |
| | |
122 | println!("Symbol Table Info:"); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `writeln!(f, ..)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_in_format_impl | |
= note: `#[warn(clippy::print_in_format_impl)]` on by default | |
warning: use of `println!` in `Display` impl | |
--> interpreter/src/sema/symbol.rs:123:9 | |
| | |
123 | println!("Scope: {}, Level: {}", &self.scope_name, &self.scope_level); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `writeln!(f, ..)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_in_format_impl | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/sema/mod.rs:60:28 | |
| | |
60 | current_scope: Arc::new(RwLock::new(SymbolTable::new( | |
| ____________________________^ | |
61 | | "Global Scope".to_string(), | |
62 | | 1, | |
63 | | None, | |
64 | | ))), | |
| |_______________^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<SymbolTable>` | |
= note: the trait `Sync` is not implemented for `RwLock<SymbolTable>` | |
= note: required for `Arc<RwLock<SymbolTable>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/sema/mod.rs:104:30 | |
| | |
104 | self.current_scope = Arc::new(RwLock::new(cur_scope)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<SymbolTable>` | |
= note: the trait `Sync` is not implemented for `RwLock<SymbolTable>` | |
= note: required for `Arc<RwLock<SymbolTable>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/sema/mod.rs:127:67 | |
| | |
127 | if let BuiltInSymbol(builtin) = current_scope.get(&builtin_token) { | |
| ^^^^^^^^^^^^^^ help: change this to: `builtin_token` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/sema/mod.rs:131:70 | |
| | |
131 | } else if let BuiltInSymbol(builtin) = current_scope.get(&token) { | |
| ^^^^^^ help: change this to: `token` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/sema/mod.rs:166:58 | |
| | |
166 | if self.current_scope.read().unwrap().lookup(&name).is_none() { | |
| ^^^^^ help: change this to: `name` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/sema/mod.rs:209:58 | |
| | |
209 | if self.current_scope.read().unwrap().lookup(&name).is_none() { | |
| ^^^^^ help: change this to: `name` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/sema/mod.rs:212:72 | |
| | |
212 | let symbol = self.current_scope.read().unwrap().lookup(&name).unwrap(); | |
| ^^^^^ help: change this to: `name` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/sema/mod.rs:218:58 | |
| | |
218 | if self.current_scope.read().unwrap().lookup(&name).is_none() { | |
| ^^^^^ help: change this to: `name` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: called `unwrap` on `size` after checking its variant with `is_some` | |
--> interpreter/src/sema/mod.rs:237:68 | |
| | |
236 | if size.is_some() { | |
| ----------------- help: try: `if let Some(..) = size` | |
237 | return Ok(Single(number_from_token(&token, size.unwrap()))); | |
| ^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/sema/mod.rs:230:67 | |
| | |
230 | let ident = self.current_scope.read().unwrap().lookup(&name); | |
| ^^^^^ help: change this to: `name` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/sema/mod.rs:257:58 | |
| | |
257 | if self.current_scope.read().unwrap().lookup(&name).is_none() { | |
| ^^^^^ help: change this to: `name` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/sema/mod.rs:335:34 | |
| | |
335 | self.current_scope = Arc::new(RwLock::new(cur_scope)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<SymbolTable>` | |
= note: the trait `Sync` is not implemented for `RwLock<SymbolTable>` | |
= note: required for `Arc<RwLock<SymbolTable>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> interpreter/src/sema/mod.rs:363:53 | |
| | |
363 | if !Number::from(&item.1 .0).eq(&actual_types.get(index).unwrap()) { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `actual_types.get(index).unwrap()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: usage of an `Arc` that is not `Send` or `Sync` | |
--> interpreter/src/sema/mod.rs:370:30 | |
| | |
370 | Some(Arc::new(RwLock::new(FuncSymbol(name, params, body)))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: the trait `Send` is not implemented for `RwLock<Symbol>` | |
= note: the trait `Sync` is not implemented for `RwLock<Symbol>` | |
= note: required for `Arc<RwLock<Symbol>>` to implement `Send` and `Sync` | |
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync | |
warning: returning the result of a `let` binding from a block | |
--> interpreter/src/sema/mod.rs:437:9 | |
| | |
436 | let ret = self.travel(&node.val_addr); | |
| -------------------------------------- unnecessary `let` binding | |
437 | ret | |
| ^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
help: return the expression directly | |
| | |
436 ~ | |
437 ~ self.travel(&node.val_addr) | |
| | |
warning: accessing first element with `values.get(0)` | |
--> interpreter/src/utils/number.rs:75:28 | |
| | |
75 | return values.get(0).unwrap().clone(); | |
| ^^^^^^^^^^^^^ help: try: `values.first()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first | |
= note: `#[warn(clippy::get_first)]` on by default | |
warning: re-implementing `PartialEq::ne` is unnecessary | |
--> interpreter/src/utils/number.rs:181:5 | |
| | |
181 | / fn ne(&self, rhs: &Self) -> bool { | |
182 | | number_binop!(self, !=, rhs, "ne", cmp) | |
183 | | } | |
| |_____^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl | |
= note: `#[warn(clippy::partialeq_ne_impl)]` on by default | |
warning: returning the result of a `let` binding from a block | |
--> interpreter/src/utils/number.rs:276:9 | |
| | |
270 | / let value = match self { | |
271 | | Felt(num) => *num as usize, | |
272 | | I32(num) => *num as usize, | |
273 | | Bool(num) => *num as usize, | |
274 | | Nil => panic!("wrong type"), | |
275 | | }; | |
| |__________- unnecessary `let` binding | |
276 | value | |
| ^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
help: return the expression directly | |
| | |
270 ~ | |
271 ~ match self { | |
272 + Felt(num) => *num as usize, | |
273 + I32(num) => *num as usize, | |
274 + Bool(num) => *num as usize, | |
275 + Nil => panic!("wrong type"), | |
276 + } | |
| | |
warning: variants `ParseIntError` and `ParseOpcodeError` are never constructed | |
--> assembler/src/error.rs:4:5 | |
| | |
2 | pub enum AssemblerError { | |
| -------------- variants in this enum | |
3 | /// parse string to integer fail | |
4 | ParseIntError, | |
| ^^^^^^^^^^^^^ | |
5 | /// parse integer to opcode fail | |
6 | ParseOpcodeError, | |
| ^^^^^^^^^^^^^^^^ | |
| | |
= note: `AssemblerError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis | |
= note: `#[warn(dead_code)]` on by default | |
warning: very complex type used. Consider factoring parts into `type` definitions | |
--> assembler/src/asm.rs:92:6 | |
| | |
92 | ) -> Result< | |
| ______^ | |
93 | | ( | |
94 | | OlaOpcode, | |
95 | | Option<OlaAsmOperand>, | |
... | | |
99 | | String, | |
100 | | > { | |
| |_^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity | |
= note: `#[warn(clippy::type_complexity)]` on by default | |
warning: single-character string constant used as pattern | |
--> assembler/src/asm.rs:101:66 | |
| | |
101 | let instruction_without_comment = &asm_line[0..asm_line.find(";").unwrap_or(asm_line.len())]; | |
| ^^^ help: try using a `char` instead: `';'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
= note: `#[warn(clippy::single_char_pattern)]` on by default | |
warning: found call to `str::trim` before `str::split_whitespace` | |
--> assembler/src/asm.rs:103:10 | |
| | |
103 | .trim() | |
| __________^ | |
104 | | .split_whitespace() | |
| |_________^ help: remove `trim()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace | |
= note: `#[warn(clippy::trim_split_whitespace)]` on by default | |
warning: accessing first element with `ops.get(0)` | |
--> assembler/src/asm.rs:146:23 | |
| | |
146 | let dst = ops.get(0).unwrap(); | |
| ^^^^^^^^^^ help: try: `ops.first()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first | |
= note: `#[warn(clippy::get_first)]` on by default | |
warning: accessing first element with `ops.get(0)` | |
--> assembler/src/asm.rs:175:27 | |
| | |
175 | let dst = ops.get(0).unwrap(); | |
| ^^^^^^^^^^ help: try: `ops.first()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first | |
warning: accessing first element with `ops.get(0)` | |
--> assembler/src/asm.rs:179:27 | |
| | |
179 | let op0 = ops.get(0).unwrap(); | |
| ^^^^^^^^^^ help: try: `ops.first()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first | |
warning: accessing first element with `ops.get(0)` | |
--> assembler/src/asm.rs:189:23 | |
| | |
189 | let op1 = ops.get(0).unwrap(); | |
| ^^^^^^^^^^ help: try: `ops.first()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first | |
warning: length comparison to zero | |
--> assembler/src/asm.rs:194:16 | |
| | |
194 | if ops.len() != 0 { | |
| ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!ops.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
= note: `#[warn(clippy::len_zero)]` on by default | |
warning: called `unwrap` on `instruction_res` after checking its variant with `is_ok` | |
--> assembler/src/asm.rs:261:36 | |
| | |
260 | return if instruction_res.is_ok() { | |
| -------------------------- help: try: `if let Ok(..) = instruction_res` | |
261 | Ok(AsmRow::Instruction(instruction_res.unwrap())) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap | |
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default | |
warning: unneeded `return` statement | |
--> assembler/src/asm.rs:260:9 | |
| | |
260 | / return if instruction_res.is_ok() { | |
261 | | Ok(AsmRow::Instruction(instruction_res.unwrap())) | |
262 | | } else { | |
263 | | Err(format!("AsmRow parse err: {}", s)) | |
264 | | }; | |
| |_________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
= note: `#[warn(clippy::needless_return)]` on by default | |
help: remove `return` | |
| | |
260 ~ if instruction_res.is_ok() { | |
261 + Ok(AsmRow::Instruction(instruction_res.unwrap())) | |
262 + } else { | |
263 + Err(format!("AsmRow parse err: {}", s)) | |
264 ~ } | |
| | |
warning: this loop could be written as a `for` loop | |
--> assembler/src/encoder.rs:30:5 | |
| | |
30 | while let Some(asm) = iter.next() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for asm in iter` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator | |
= note: `#[warn(clippy::while_let_on_iterator)]` on by default | |
warning: very complex type used. Consider factoring parts into `type` definitions | |
--> assembler/src/encoder.rs:31:25 | |
| | |
31 | let ops_result: Result< | |
| _________________________^ | |
32 | | (Option<OlaOperand>, Option<OlaOperand>, Option<OlaOperand>), | |
33 | | String, | |
34 | | > = if is_adjusted_operand(asm) { | |
| |_________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity | |
warning: manual implementation of `Option::map` | |
--> assembler/src/encoder.rs:86:13 | |
| | |
86 | / if let Some(asm_prophet) = asm_prophets.get(&binary_counter) { | |
87 | | Some(OlaProphet { | |
88 | | host: binary_counter.clone(), | |
89 | | code: asm_prophet.code.clone(), | |
... | | |
95 | | None | |
96 | | }; | |
| |_____________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map | |
= note: `#[warn(clippy::manual_map)]` on by default | |
help: try | |
| | |
86 ~ asm_prophets.get(&binary_counter).map(|asm_prophet| OlaProphet { | |
87 + host: binary_counter.clone(), | |
88 + code: asm_prophet.code.clone(), | |
89 + ctx: Vec::new(), | |
90 + inputs: asm_prophet.inputs.clone(), | |
91 + outputs: asm_prophet.outputs.clone(), | |
92 ~ }); | |
| | |
warning: using `clone` on type `usize` which implements the `Copy` trait | |
--> assembler/src/encoder.rs:88:27 | |
| | |
88 | host: binary_counter.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `binary_counter` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
= note: `#[warn(clippy::clone_on_copy)]` on by default | |
warning: this if-then-else expression returns a bool literal | |
--> assembler/src/encoder.rs:117:5 | |
| | |
117 | / if asm.opcode == OlaOpcode::MLOAD || asm.opcode == OlaOpcode::MSTORE { | |
118 | | true | |
119 | | } else { | |
120 | | false | |
121 | | } | |
| |_____^ help: you can reduce it to: `asm.opcode == OlaOpcode::MLOAD || asm.opcode == OlaOpcode::MSTORE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool | |
= note: `#[warn(clippy::needless_bool)]` on by default | |
warning: called `unwrap` on `special_reg` after checking its variant with `is_ok` | |
--> assembler/src/operands.rs:167:30 | |
| | |
165 | if special_reg.is_ok() { | |
| ---------------------- help: try: `if let Ok(..) = special_reg` | |
166 | return Ok(OlaAsmOperand::SpecialReg { | |
167 | special_reg: special_reg.unwrap(), | |
| ^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap | |
warning: unneeded `return` statement | |
--> assembler/src/operands.rs:179:9 | |
| | |
179 | return Err(format!("invalid asm operand: {}", s)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
179 - return Err(format!("invalid asm operand: {}", s)); | |
179 + Err(format!("invalid asm operand: {}", s)) | |
| | |
warning: useless use of `format!` | |
--> assembler/src/relocate.rs:79:24 | |
| | |
79 | return Err(format!("generate scopes error, no scope found")); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"generate scopes error, no scope found".to_string()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format | |
= note: `#[warn(clippy::useless_format)]` on by default | |
warning: useless use of `format!` | |
--> assembler/src/relocate.rs:82:24 | |
| | |
82 | return Err(format!("generate scopes error, no main scope found")); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"generate scopes error, no main scope found".to_string()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format | |
warning: this loop could be written as a `while let` loop | |
--> assembler/src/relocate.rs:134:5 | |
| | |
134 | / loop { | |
135 | | if let Some(line) = lines.next() { | |
136 | | let row_res = AsmRow::from_str(line); | |
137 | | if row_res.is_err() { | |
... | | |
206 | | } | |
207 | | } | |
| |_____^ help: try: `while let Some(line) = lines.next() { .. }` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop | |
= note: `#[warn(clippy::while_let_loop)]` on by default | |
warning: this loop could be written as a `for` loop | |
--> assembler/src/relocate.rs:212:5 | |
| | |
212 | while let Some(prophet) = prophets_iter.next() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for prophet in prophets_iter` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator | |
warning: using `clone` on type `usize` which implements the `Copy` trait | |
--> assembler/src/relocate.rs:220:25 | |
| | |
220 | prophets.insert(host.unwrap().clone(), prophet.clone()); | |
| ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*host.unwrap()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: called `unwrap` on `comment_start` after checking its variant with `is_some` | |
--> assembler/src/relocate.rs:234:17 | |
| | |
233 | let without_comment: &str = if comment_start.is_some() { | |
| -------------------------- help: try: `if let Some(..) = comment_start` | |
234 | &line[..comment_start.unwrap()] | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap | |
warning: single-character string constant used as pattern | |
--> assembler/src/relocate.rs:232:35 | |
| | |
232 | let comment_start = line.find(";"); | |
| ^^^ help: try using a `char` instead: `';'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
warning: call to `.clone()` on a reference in this situation does nothing | |
--> assembler/src/relocate.rs:34:62 | |
| | |
34 | let row_res = AsmRow::from_str(processed_line.clone()); | |
| ^^^^^^^^ help: remove this redundant call | |
| | |
= note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed | |
= note: `#[warn(noop_method_call)]` on by default | |
warning: `interpreter` (lib) generated 91 warnings (run `cargo clippy --fix --lib -p interpreter` to apply 46 suggestions) | |
warning: `assembler` (lib) generated 26 warnings (run `cargo clippy --fix --lib -p assembler` to apply 19 suggestions) | |
warning: unused import: `info` | |
--> executor/src/lib.rs:35:18 | |
| | |
35 | use log::{debug, info}; | |
| ^^^^ | |
| | |
= note: `#[warn(unused_imports)]` on by default | |
warning: unused import: `u8_arr_to_tree_key` | |
--> executor/src/ecdsa.rs:1:52 | |
| | |
1 | use core::types::merkle_tree::{tree_key_to_u8_arr, u8_arr_to_tree_key}; | |
| ^^^^^^^^^^^^^^^^^^ | |
warning: unused import: `TreeKey` | |
--> executor/src/ecdsa.rs:2:32 | |
| | |
2 | use core::types::merkle_tree::{TreeKey, TreeValue}; | |
| ^^^^^^^ | |
warning: unused imports: `BigUint`, `Num` | |
--> executor/src/ecdsa.rs:4:11 | |
| | |
4 | use num::{BigUint, Num}; | |
| ^^^^^^^ ^^^ | |
warning: use of deprecated associated function `secp256k1::Message::from_slice`: use from_digest_slice instead | |
--> executor/src/ecdsa.rs:36:18 | |
| | |
36 | Message::from_slice(&msg_arr).map_err(|e| ProcessorError::MessageInvalid(e.to_string()))?; | |
| ^^^^^^^^^^ | |
| | |
= note: `#[warn(deprecated)]` on by default | |
warning: variable does not need to be mutable | |
--> executor/src/load_tx.rs:73:5 | |
| | |
73 | mut calldata: Vec<GoldilocksField>, | |
| ----^^^^^^^^ | |
| | | |
| help: remove this `mut` | |
| | |
= note: `#[warn(unused_mut)]` on by default | |
warning: value assigned to `data` is never read | |
--> executor/src/lib.rs:1819:21 | |
| | |
1819 | let mut data = GoldilocksField::ZERO; | |
| ^^^^ | |
| | |
= help: maybe it is overwritten before being read? | |
= note: `#[warn(unused_assignments)]` on by default | |
warning: value assigned to `data` is never read | |
--> executor/src/lib.rs:1820:48 | |
| | |
1820 | memory_op!(self, msg_mem_addr + i, data, Opcode::MSTORE); | |
| ^^^^ | |
| | |
= help: maybe it is overwritten before being read? | |
warning: value assigned to `data` is never read | |
--> executor/src/lib.rs:1828:21 | |
| | |
1828 | let mut data = GoldilocksField::ZERO; | |
| ^^^^ | |
| | |
= help: maybe it is overwritten before being read? | |
warning: value assigned to `data` is never read | |
--> executor/src/lib.rs:1829:45 | |
| | |
1829 | memory_op!(self, pk_x_addr + i, data, Opcode::MSTORE); | |
| ^^^^ | |
| | |
= help: maybe it is overwritten before being read? | |
warning: value assigned to `data` is never read | |
--> executor/src/lib.rs:1837:21 | |
| | |
1837 | let mut data = GoldilocksField::ZERO; | |
| ^^^^ | |
| | |
= help: maybe it is overwritten before being read? | |
warning: value assigned to `data` is never read | |
--> executor/src/lib.rs:1838:45 | |
| | |
1838 | memory_op!(self, pk_y_addr + i, data, Opcode::MSTORE); | |
| ^^^^ | |
| | |
= help: maybe it is overwritten before being read? | |
warning: value assigned to `data` is never read | |
--> executor/src/lib.rs:1846:21 | |
| | |
1846 | let mut data = GoldilocksField::ZERO; | |
| ^^^^ | |
| | |
= help: maybe it is overwritten before being read? | |
warning: value assigned to `data` is never read | |
--> executor/src/lib.rs:1847:46 | |
| | |
1847 | memory_op!(self, sig_r_addr + i, data, Opcode::MSTORE); | |
| ^^^^ | |
| | |
= help: maybe it is overwritten before being read? | |
warning: value assigned to `data` is never read | |
--> executor/src/lib.rs:1855:21 | |
| | |
1855 | let mut data = GoldilocksField::ZERO; | |
| ^^^^ | |
| | |
= help: maybe it is overwritten before being read? | |
warning: value assigned to `data` is never read | |
--> executor/src/lib.rs:1856:46 | |
| | |
1856 | memory_op!(self, sig_s_addr + i, data, Opcode::MSTORE); | |
| ^^^^ | |
| | |
= help: maybe it is overwritten before being read? | |
warning: using `clone` on type `GoldilocksField` which implements the `Copy` trait | |
--> executor/src/load_tx.rs:18:13 | |
| | |
18 | data.clone(), | |
| ^^^^^^^^^^^^ help: try dereferencing it: `*data` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
= note: `#[warn(clippy::clone_on_copy)]` on by default | |
warning: unneeded `return` statement | |
--> executor/src/storage.rs:28:9 | |
| | |
28 | return order; | |
| ^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
= note: `#[warn(clippy::needless_return)]` on by default | |
help: remove `return` | |
| | |
28 - return order; | |
28 + order | |
| | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> executor/src/trace.rs:286:21 | |
| | |
286 | let mut trace = std::mem::replace(&mut process.storage_log, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut process.storage_log)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
= note: `#[warn(clippy::mem_replace_with_default)]` on by default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> executor/src/trace.rs:287:18 | |
| | |
287 | trace.extend(std::mem::replace(&mut process.program_log, Vec::new())); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut process.program_log)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> executor/src/trace.rs:364:17 | |
| | |
364 | let trace = std::mem::replace(&mut process.storage.trace, HashMap::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut process.storage.trace)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: use Vec::sort here instead | |
--> executor/src/trace.rs:367:5 | |
| | |
367 | traces.sort_by(|a, b| a.cmp(b)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `traces.sort()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by | |
= note: `#[warn(clippy::unnecessary_sort_by)]` on by default | |
warning: useless use of `format!` | |
--> executor/src/trace.rs:452:33 | |
| | |
452 | let mut file = File::create(format!("dump.json")).unwrap(); | |
| ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"dump.json".to_string()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format | |
= note: `#[warn(clippy::useless_format)]` on by default | |
warning: you should consider adding a `Default` implementation for `Process` | |
--> executor/src/lib.rs:220:5 | |
| | |
220 | / pub fn new() -> Self { | |
221 | | Self { | |
222 | | env_idx: Default::default(), | |
223 | | call_sc_cnt: Default::default(), | |
... | | |
250 | | } | |
251 | | } | |
| |_____^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default | |
= note: `#[warn(clippy::new_without_default)]` on by default | |
help: try adding this | |
| | |
219 + impl Default for Process { | |
220 + fn default() -> Self { | |
221 + Self::new() | |
222 + } | |
223 + } | |
| | |
warning: unneeded `return` statement | |
--> executor/src/lib.rs:272:13 | |
| | |
272 | / return ( | |
273 | | GoldilocksField::from_canonical_u64(data), | |
274 | | ImmediateOrRegName::Immediate(GoldilocksField::from_canonical_u64(data)), | |
275 | | ); | |
| |_____________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
272 ~ ( | |
273 + GoldilocksField::from_canonical_u64(data), | |
274 + ImmediateOrRegName::Immediate(GoldilocksField::from_canonical_u64(data)), | |
275 ~ ) | |
| | |
warning: unneeded `return` statement | |
--> executor/src/lib.rs:279:17 | |
| | |
279 | return (self.psp_start, ImmediateOrRegName::RegName(src_index)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
279 - return (self.psp_start, ImmediateOrRegName::RegName(src_index)); | |
279 + (self.psp_start, ImmediateOrRegName::RegName(src_index)) | |
| | |
warning: casting integer literal to `u64` is unnecessary | |
--> executor/src/lib.rs:306:57 | |
| | |
306 | GoldilocksField::from_canonical_u64(0 as u64), | |
| ^^^^^^^^ help: try: `0_u64` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast | |
= note: `#[warn(clippy::unnecessary_cast)]` on by default | |
warning: casting integer literal to `u64` is unnecessary | |
--> executor/src/lib.rs:323:57 | |
| | |
323 | GoldilocksField::from_canonical_u64(0 as u64), | |
| ^^^^^^^^ help: try: `0_u64` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> executor/src/lib.rs:352:53 | |
| | |
352 | let value = self.read_prophet_input(&input, reg_cnt, &mut reg_index, &mut fp)?; | |
| ^^^^^^ help: change this to: `input` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
= note: `#[warn(clippy::needless_borrow)]` on by default | |
warning: this expression creates a reference which is immediately dereferenced by the compiler | |
--> executor/src/lib.rs:358:49 | |
| | |
358 | self.read_prophet_input(&input, reg_cnt, &mut reg_index, &mut fp)?; | |
| ^^^^^^ help: change this to: `input` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow | |
warning: casting integer literal to `u64` is unnecessary | |
--> executor/src/lib.rs:381:65 | |
| | |
381 | ... GoldilocksField::from_canonical_u64(0 as u64), | |
| ^^^^^^^^ help: try: `0_u64` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:523:9 | |
| | |
523 | / assert_eq!( | |
524 | | ops.len(), | |
525 | | 3, | |
526 | | "{}", | |
527 | | format!("{} params len is 2", opcode.as_str()) | |
528 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
= note: `#[warn(clippy::format_in_format_args)]` on by default | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:561:9 | |
| | |
561 | / assert_eq!( | |
562 | | ops.len(), | |
563 | | 4, | |
564 | | "{}", | |
565 | | format!("{} params len is 3", opcode.as_str()) | |
566 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:612:9 | |
| | |
612 | / assert_eq!( | |
613 | | ops.len(), | |
614 | | 2, | |
615 | | "{}", | |
616 | | format!("{} params len is 2", opcode.as_str()) | |
617 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:648:9 | |
| | |
648 | / assert_eq!( | |
649 | | ops.len(), | |
650 | | 3, | |
651 | | "{}", | |
652 | | format!("{} params len is 2", opcode.as_str()) | |
653 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:672:9 | |
| | |
672 | / assert_eq!( | |
673 | | ops.len(), | |
674 | | 2, | |
675 | | "{}", | |
676 | | format!("{} params len is 1", opcode.as_str()) | |
677 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:689:9 | |
| | |
689 | / assert_eq!( | |
690 | | ops.len(), | |
691 | | 4, | |
692 | | "{}", | |
693 | | format!("{} params len is 3", opcode.as_str()) | |
694 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:731:9 | |
| | |
731 | / assert_eq!( | |
732 | | ops.len(), | |
733 | | 2, | |
734 | | "{}", | |
735 | | format!("{} params len is 1", opcode.as_str()) | |
736 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: unneeded late initialization | |
--> executor/src/lib.rs:95:9 | |
| | |
95 | / $read_addr = $v.memory.read( | |
96 | | $mem_addr, | |
97 | | $v.clk, | |
98 | | GoldilocksField::from_canonical_u64(1 << $opcode as u64), | |
... | | |
104 | | $v.env_idx, | |
105 | | )?; | |
| |__________^ initialised here | |
... | |
765 | let pc_value; | |
| ^^^^^^^^^^^^^ created here | |
766 | let pc_addr = self.registers[FP_REG_INDEX].0 - 1; | |
767 | memory_op!(self, pc_addr, pc_value, Opcode::RET); | |
| ------------------------------------------------ in this macro invocation | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init | |
= note: `#[warn(clippy::needless_late_init)]` on by default | |
= note: this warning originates in the macro `memory_op` (in Nightly builds, run with -Z macro-backtrace for more info) | |
help: declare `pc_value` here | |
| | |
767 | memory_op!(self, pc_addr, let pc_value, Opcode::RET); | |
| ~~~~~~~~~~~~ | |
warning: this call to `from_str_radix` can be replaced with a call to `str::parse` | |
--> executor/src/lib.rs:794:30 | |
| | |
794 | let offset_res = u64::from_str_radix(ops[2], 10); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ops[2].parse::<u64>()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 | |
= note: `#[warn(clippy::from_str_radix_10)]` on by default | |
warning: this call to `from_str_radix` can be replaced with a call to `str::parse` | |
--> executor/src/lib.rs:807:30 | |
| | |
807 | let offset_res = u64::from_str_radix(ops[3], 10); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ops[3].parse::<u64>()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 | |
warning: this call to `from_str_radix` can be replaced with a call to `str::parse` | |
--> executor/src/lib.rs:857:30 | |
| | |
857 | let offset_res = u64::from_str_radix(ops[3], 10); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ops[3].parse::<u64>()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 | |
warning: this call to `from_str_radix` can be replaced with a call to `str::parse` | |
--> executor/src/lib.rs:870:30 | |
| | |
870 | let offset_res = u64::from_str_radix(ops[4], 10); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ops[4].parse::<u64>()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:899:9 | |
| | |
899 | / assert_eq!( | |
900 | | ops.len(), | |
901 | | 2, | |
902 | | "{}", | |
903 | | format!("{} params len is 1", opcode.as_str()) | |
904 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:932:9 | |
| | |
932 | / assert_eq!( | |
933 | | ops.len(), | |
934 | | 4, | |
935 | | "{}", | |
936 | | format!("{} params len is 3", opcode.as_str()) | |
937 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:992:9 | |
| | |
992 | / assert_eq!( | |
993 | | ops.len(), | |
994 | | 4, | |
995 | | "{}", | |
996 | | format!("{} params len is 3", opcode.as_str()) | |
997 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: unneeded late initialization | |
--> executor/src/lib.rs:1026:13 | |
| | |
1026 | let abs_diff; | |
| ^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init | |
help: declare `abs_diff` here | |
| | |
1027 | let abs_diff = if self.register_selector.dst.is_one() { | |
| ++++++++++++++ | |
help: remove the assignments from the branches | |
| | |
1028 ~ self.register_selector.op0 - self.register_selector.op1 | |
1029 | } else { | |
1030 ~ self.register_selector.op1 - self.register_selector.op0 | |
| | |
help: add a semicolon after the `if` expression | |
| | |
1031 | }; | |
| + | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1095:17 | |
| | |
1095 | ctx_regs_status.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 10]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1096:17 | |
| | |
1096 | registers_status.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*registers_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1101:17 | |
| | |
1101 | ctx_code_regs_status.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_code_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: this function has too many arguments (8/7) | |
--> executor/src/lib.rs:1136:5 | |
| | |
1136 | / fn execute_inst_sstore( | |
1137 | | &mut self, | |
1138 | | program: &mut Program, | |
1139 | | aux_steps: &mut Vec<Step>, | |
... | | |
1144 | | ctx_code_regs_status: &Address, | |
1145 | | ) -> Result<(), ProcessorError> { | |
| |___________________________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
= note: `#[warn(clippy::too_many_arguments)]` on by default | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1180:62 | |
| | |
1180 | let storage_key = StorageKey::new(AccountTreeId::new(self.addr_storage.clone()), slot_key); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.addr_storage` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1204:35 | |
| | |
1204 | let ctx_regs_status = ctx_regs_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1205:40 | |
| | |
1205 | let ctx_code_regs_status = ctx_code_regs_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_code_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 10]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1206:36 | |
| | |
1206 | let registers_status = registers_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*registers_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: this function has too many arguments (9/7) | |
--> executor/src/lib.rs:1244:5 | |
| | |
1244 | / fn execute_inst_sload( | |
1245 | | &mut self, | |
1246 | | program: &mut Program, | |
1247 | | account_tree: &mut AccountTree, | |
... | | |
1253 | | ctx_code_regs_status: &Address, | |
1254 | | ) -> Result<(), ProcessorError> { | |
| |___________________________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: the loop variable `index` is used to index `slot_key` | |
--> executor/src/lib.rs:1274:22 | |
| | |
1274 | for index in 0..TREE_VALUE_LEN { | |
| ^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
= note: `#[warn(clippy::needless_range_loop)]` on by default | |
help: consider using an iterator and enumerate() | |
| | |
1274 | for (index, <item>) in slot_key.iter_mut().enumerate().take(TREE_VALUE_LEN) { | |
| ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1282:62 | |
| | |
1282 | let storage_key = StorageKey::new(AccountTreeId::new(self.addr_storage.clone()), slot_key); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.addr_storage` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1289:26 | |
| | |
1289 | read_value = data.last().unwrap().value.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `data.last().unwrap().value` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: the loop variable `index` is used to index `read_value` | |
--> executor/src/lib.rs:1300:22 | |
| | |
1300 | for index in 0..TREE_VALUE_LEN { | |
| ^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator and enumerate() | |
| | |
1300 | for (index, <item>) in read_value.iter().enumerate().take(TREE_VALUE_LEN) { | |
| ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1335:35 | |
| | |
1335 | let ctx_regs_status = ctx_regs_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1336:40 | |
| | |
1336 | let ctx_code_regs_status = ctx_code_regs_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_code_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 10]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1337:36 | |
| | |
1337 | let registers_status = registers_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*registers_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: casting to the same type is unnecessary (`usize` -> `usize`) | |
--> executor/src/lib.rs:1475:50 | |
| | |
1475 | memory_op!(self, mem_addr, input[index as usize], Opcode::POSEIDON); | |
| ^^^^^^^^^^^^^^ help: try: `index` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast | |
warning: the loop variable `index` is used to index `output` | |
--> executor/src/lib.rs:1501:22 | |
| | |
1501 | for index in 0..POSEIDON_OUTPUT_VALUE_LEN { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator and enumerate() | |
| | |
1501 | for (index, <item>) in output.iter().enumerate().take(POSEIDON_OUTPUT_VALUE_LEN) { | |
| ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: this function has too many arguments (8/7) | |
--> executor/src/lib.rs:1516:5 | |
| | |
1516 | / fn execute_inst_tload( | |
1517 | | &mut self, | |
1518 | | _program: &mut Program, | |
1519 | | aux_steps: &mut Vec<Step>, | |
... | | |
1524 | | ctx_code_regs_status: &Address, | |
1525 | | ) -> Result<(), ProcessorError> { | |
| |___________________________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:1527:9 | |
| | |
1527 | / assert_eq!( | |
1528 | | ops.len(), | |
1529 | | 4, | |
1530 | | "{}", | |
1531 | | format!("{} params len is not match", opcode.as_str()) | |
1532 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1571:31 | |
| | |
1571 | let ctx_regs_status = ctx_regs_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1572:36 | |
| | |
1572 | let ctx_code_regs_status = ctx_code_regs_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_code_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 10]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1573:32 | |
| | |
1573 | let registers_status = registers_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*registers_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:1609:9 | |
| | |
1609 | / assert_eq!( | |
1610 | | ops.len(), | |
1611 | | 3, | |
1612 | | "{}", | |
1613 | | format!("{} params len is not match", opcode.as_str()) | |
1614 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1637:31 | |
| | |
1637 | let ctx_regs_status = ctx_regs_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1638:36 | |
| | |
1638 | let ctx_code_regs_status = ctx_code_regs_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_code_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 10]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1639:32 | |
| | |
1639 | let registers_status = registers_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*registers_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: this function has too many arguments (8/7) | |
--> executor/src/lib.rs:1666:5 | |
| | |
1666 | / fn execute_inst_sccall( | |
1667 | | &mut self, | |
1668 | | program: &mut Program, | |
1669 | | ops: &[&str], | |
... | | |
1674 | | ctx_code_regs_status: &Address, | |
1675 | | ) -> Result<VMState, ProcessorError> { | |
| |________________________________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: unneeded `return` statement | |
--> executor/src/lib.rs:1788:13 | |
| | |
1788 | return Ok(VMState::SCCall(SCCallType::DelegateCall(callee_address))); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
help: remove `return` | |
| | |
1788 - return Ok(VMState::SCCall(SCCallType::DelegateCall(callee_address))); | |
1788 + Ok(VMState::SCCall(SCCallType::DelegateCall(callee_address))) | |
| | |
warning: `format!` in `assert_eq!` args | |
--> executor/src/lib.rs:1677:9 | |
| | |
1677 | / assert_eq!( | |
1678 | | ops.len(), | |
1679 | | 3, | |
1680 | | "{}", | |
1681 | | format!("{} params len is not match", opcode.as_str()) | |
1682 | | ); | |
| |_________^ | |
| | |
= help: combine the `format!(..)` arguments with the outer `assert_eq!(..)` call | |
= help: or consider changing `format!` to `format_args!` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args | |
warning: using `clone` on type `[GoldilocksField; 10]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1734:17 | |
| | |
1734 | registers_status.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*registers_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1747:17 | |
| | |
1747 | ctx_regs_status.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 10]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1748:17 | |
| | |
1748 | registers_status.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*registers_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1753:17 | |
| | |
1753 | ctx_code_regs_status.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_code_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 10]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1773:17 | |
| | |
1773 | registers_status.clone(), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*registers_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: this function has too many arguments (8/7) | |
--> executor/src/lib.rs:1796:5 | |
| | |
1796 | / fn execute_inst_sigcheck( | |
1797 | | &mut self, | |
1798 | | program: &mut Program, | |
1799 | | aux_steps: &mut Vec<Step>, | |
... | | |
1804 | | ctx_code_regs_status: &Address, | |
1805 | | ) -> Result<(), ProcessorError> { | |
| |___________________________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1874:35 | |
| | |
1874 | let ctx_regs_status = ctx_regs_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1875:40 | |
| | |
1875 | let ctx_code_regs_status = ctx_code_regs_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*ctx_code_regs_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 10]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1876:36 | |
| | |
1876 | let registers_status = registers_status.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*registers_status` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: casting integer literal to `u64` is unnecessary | |
--> executor/src/lib.rs:1910:53 | |
| | |
1910 | GoldilocksField::from_canonical_u64(0 as u64), | |
| ^^^^^^^^ help: try: `0_u64` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1954:35 | |
| | |
1954 | let ctx_regs_status = self.addr_storage.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.addr_storage` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> executor/src/lib.rs:1955:40 | |
| | |
1955 | let ctx_code_regs_status = self.addr_code.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.addr_code` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: `executor` (lib) generated 89 warnings (run `cargo clippy --fix --lib -p executor` to apply 52 suggestions) | |
Checking circuits v0.1.0 (/home/matthias/mozak/prog/olavm/olavm/circuits) | |
warning: unused import: `OlaProphet` | |
--> zk-vm/src/lib.rs:8:56 | |
| | |
8 | use ola_core::program::binary_program::{BinaryProgram, OlaProphet}; | |
| ^^^^^^^^^^ | |
| | |
= note: `#[warn(unused_imports)]` on by default | |
warning: unused import: `ola_core::crypto::hash::Hasher` | |
--> zk-vm/src/lib.rs:26:5 | |
| | |
26 | use ola_core::crypto::hash::Hasher; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
warning: unused import: `ola_core::types::storage::field_arr_to_u8_arr` | |
--> zk-vm/src/lib.rs:28:5 | |
| | |
28 | use ola_core::types::storage::field_arr_to_u8_arr; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
warning: unused import: `BTreeMap` | |
--> zk-vm/src/lib.rs:29:24 | |
| | |
29 | use std::collections::{BTreeMap, HashMap}; | |
| ^^^^^^^^ | |
warning: unused import: `Write` | |
--> zk-vm/src/lib.rs:31:26 | |
| | |
31 | use std::io::{BufReader, Write}; | |
| ^^^^^ | |
warning: unused import: `std::ops::Not` | |
--> zk-vm/src/lib.rs:32:5 | |
| | |
32 | use std::ops::Not; | |
| ^^^^^^^^^^^^^ | |
warning: very complex type used. Consider factoring parts into `type` definitions | |
--> zk-vm/src/lib.rs:46:22 | |
| | |
46 | pub process_ctx: Vec<(Arc<Mutex<Process>>, Arc<Mutex<Program>>, Address, Address)>, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity | |
= note: `#[warn(clippy::type_complexity)]` on by default | |
warning: single-character string constant used as pattern | |
--> zk-vm/src/lib.rs:169:59 | |
| | |
169 | let instructions = bin_program.bytecode.split("\n"); | |
| ^^^^ help: try using a `char` instead: `'\n'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
= note: `#[warn(clippy::single_char_pattern)]` on by default | |
warning: single-character string constant used as pattern | |
--> zk-vm/src/lib.rs:218:51 | |
| | |
218 | let instructions = program.bytecode.split("\n"); | |
| ^^^^ help: try using a `char` instead: `'\n'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> zk-vm/src/lib.rs:236:52 | |
| | |
236 | storage_log: StorageLog::new_write_log(addr.clone(), code_hash), | |
| ^^^^^^^^^^^^ help: try dereferencing it: `*addr` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
= note: `#[warn(clippy::clone_on_copy)]` on by default | |
warning: using `clone` on type `GoldilocksField` which implements the `Copy` trait | |
--> zk-vm/src/lib.rs:287:30 | |
| | |
287 | let tp = mutex_data!(process).tp.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `mutex_data!(process).tp` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `GoldilocksField` which implements the `Copy` trait | |
--> zk-vm/src/lib.rs:299:47 | |
| | |
299 | mutex_data!(process).tp = tp.clone(); | |
| ^^^^^^^^^^ help: try removing the `clone` call: `tp` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> zk-vm/src/lib.rs:307:43 | |
| | |
307 | ... caller_addr = addr.clone(); | |
| ^^^^^^^^^^^^ help: try dereferencing it: `*addr` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> zk-vm/src/lib.rs:308:45 | |
| | |
308 | ... code_exe_addr = addr.clone(); | |
| ^^^^^^^^^^^^ help: try dereferencing it: `*addr` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> zk-vm/src/lib.rs:312:45 | |
| | |
312 | ... code_exe_addr = addr.clone(); | |
| ^^^^^^^^^^^^ help: try dereferencing it: `*addr` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> zk-vm/src/lib.rs:345:29 | |
| | |
345 | ... std::mem::replace(&mut mutex_data!(program).trace, Trace::default()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut mutex_data!(program).trace)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
= note: `#[warn(clippy::mem_replace_with_default)]` on by default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> zk-vm/src/lib.rs:353:29 | |
| | |
353 | ... std::mem::replace(&mut mutex_data!(program).trace, Trace::default()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut mutex_data!(program).trace)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: using `clone` on type `GoldilocksField` which implements the `Copy` trait | |
--> zk-vm/src/lib.rs:355:34 | |
| | |
355 | let tp = mutex_data!(process).tp.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `mutex_data!(process).tp` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: using `clone` on type `u32` which implements the `Copy` trait | |
--> zk-vm/src/lib.rs:356:35 | |
| | |
356 | let clk = mutex_data!(process).clk.clone(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `mutex_data!(process).clk` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> zk-vm/src/lib.rs:360:29 | |
| | |
360 | ... std::mem::replace(&mut mutex_data!(process).program_log, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut mutex_data!(process).program_log)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> zk-vm/src/lib.rs:362:29 | |
| | |
362 | ... std::mem::replace(&mut mutex_data!(process).storage_log, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut mutex_data!(process).storage_log)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> zk-vm/src/lib.rs:363:44 | |
| | |
363 | let storage_tree = std::mem::replace( | |
| ____________________________________________^ | |
364 | | &mut mutex_data!(process).storage.trace, | |
365 | | HashMap::new(), | |
366 | | ); | |
| |_________________________^ help: consider using: `std::mem::take(&mut mutex_data!(process).storage.trace)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> zk-vm/src/lib.rs:379:36 | |
| | |
379 | let exec = std::mem::replace(&mut trace.exec, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut trace.exec)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: `zk-vm` (lib) generated 23 warnings (run `cargo clippy --fix --lib -p zk-vm` to apply 22 suggestions) | |
warning: unused import: `core::types::Field` | |
--> circuits/src/builtins/poseidon/poseidon_chunk_stark.rs:289:9 | |
| | |
289 | use core::types::Field; | |
| ^^^^^^^^^^^^^^^^^^ | |
| | |
= note: `#[warn(unused_imports)]` on by default | |
warning: unused import: `core::types::Field` | |
--> circuits/src/builtins/poseidon/poseidon_stark.rs:184:9 | |
| | |
184 | use core::types::Field; | |
| ^^^^^^^^^^^^^^^^^^ | |
warning: unused import: `std::ops::Range` | |
--> circuits/src/cpu/cpu_stark.rs:18:5 | |
| | |
18 | std::ops::Range, | |
| ^^^^^^^^^^^^^^^ | |
warning: unused imports: `Field`, `GoldilocksField`, `merkle_tree::decode_addr` | |
--> circuits/src/generation/ctl_test/chunk_poseidon.rs:1:19 | |
| | |
1 | use core::types::{merkle_tree::decode_addr, Field, GoldilocksField}; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^ | |
warning: unused imports: `builtins::poseidon::columns::*`, `poseidon::generate_poseidon_trace`, `poseidon_chunk::generate_poseidon_chunk_trace`, `prog::generate_prog_chunk_trace`, `program::columns::*` | |
--> circuits/src/generation/ctl_test/chunk_poseidon.rs:4:5 | |
| | |
4 | builtins::poseidon::columns::*, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
5 | generation::{ | |
6 | poseidon::generate_poseidon_trace, poseidon_chunk::generate_poseidon_chunk_trace, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
7 | prog::generate_prog_chunk_trace, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
8 | }, | |
9 | program::columns::*, | |
| ^^^^^^^^^^^^^^^^^^^ | |
warning: unused imports: `get_exec_trace`, `get_rows_vec_from_trace`, `print_title_data` | |
--> circuits/src/generation/ctl_test/chunk_poseidon.rs:12:32 | |
| | |
12 | use super::debug_trace_print::{get_exec_trace, get_rows_vec_from_trace, print_title_data}; | |
| ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ | |
warning: unused imports: `Field`, `GoldilocksField`, `merkle_tree::decode_addr` | |
--> circuits/src/generation/ctl_test/cpu_program.rs:1:19 | |
| | |
1 | use core::types::{merkle_tree::decode_addr, Field, GoldilocksField}; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^ | |
warning: unused imports: `cpu::columns::*`, `cpu::generate_cpu_trace`, `prog::generate_prog_trace`, `program::columns::*` | |
--> circuits/src/generation/ctl_test/cpu_program.rs:4:5 | |
| | |
4 | cpu::columns::*, | |
| ^^^^^^^^^^^^^^^ | |
5 | generation::{cpu::generate_cpu_trace, prog::generate_prog_trace}, | |
| ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
6 | program::columns::*, | |
| ^^^^^^^^^^^^^^^^^^^ | |
warning: unused imports: `get_exec_trace`, `get_rows_vec_from_trace`, `print_title_data` | |
--> circuits/src/generation/ctl_test/cpu_program.rs:9:32 | |
| | |
9 | use super::debug_trace_print::{get_exec_trace, get_rows_vec_from_trace, print_title_data}; | |
| ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ | |
warning: unused imports: `get_exec_trace`, `get_rows_vec_from_trace`, `print_title_data` | |
--> circuits/src/generation/ctl_test/cpu_tape.rs:10:32 | |
| | |
10 | use super::debug_trace_print::{get_exec_trace, get_rows_vec_from_trace, print_title_data}; | |
| ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ | |
warning: unused import: `itertools::Itertools` | |
--> circuits/src/generation/ctl_test/poseidon_chunk_mem.rs:1:5 | |
| | |
1 | use itertools::Itertools; | |
| ^^^^^^^^^^^^^^^^^^^^ | |
warning: unused imports: `Field`, `GoldilocksField`, `merkle_tree::decode_addr` | |
--> circuits/src/generation/ctl_test/prog_chunk_program.rs:1:19 | |
| | |
1 | use core::types::{merkle_tree::decode_addr, Field, GoldilocksField}; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^ | |
warning: unused imports: `generate_prog_chunk_trace`, `generate_prog_trace`, `program::columns::*` | |
--> circuits/src/generation/ctl_test/prog_chunk_program.rs:4:24 | |
| | |
4 | generation::prog::{generate_prog_chunk_trace, generate_prog_trace}, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ | |
5 | program::columns::*, | |
| ^^^^^^^^^^^^^^^^^^^ | |
warning: unused imports: `get_exec_trace`, `get_rows_vec_from_trace`, `print_title_data` | |
--> circuits/src/generation/ctl_test/prog_chunk_program.rs:8:32 | |
| | |
8 | use super::debug_trace_print::{get_exec_trace, get_rows_vec_from_trace, print_title_data}; | |
| ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ | |
warning: unused import: `maybe_rayon::MaybeParIter` | |
--> circuits/src/stark/lookup.rs:4:5 | |
| | |
4 | use maybe_rayon::MaybeParIter; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
warning: unused imports: `Arc`, `Mutex` | |
--> circuits/src/stark/prover.rs:4:17 | |
| | |
4 | use std::sync::{Arc, Mutex}; | |
| ^^^ ^^^^^ | |
warning: unused import: `std::time::Instant` | |
--> circuits/src/stark/prover.rs:5:5 | |
| | |
5 | use std::time::Instant; | |
| ^^^^^^^^^^^^^^^^^^ | |
warning: unused import: `crate::builtins::rangecheck::rangecheck_stark::RangeCheckStark` | |
--> circuits/src/stark/prover.rs:30:5 | |
| | |
30 | use crate::builtins::rangecheck::rangecheck_stark::RangeCheckStark; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
warning: unneeded unit return type | |
--> circuits/src/test_utils.rs:31:6 | |
| | |
31 | ) -> (), | |
| ^^^^^^ help: remove the `-> ()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit | |
= note: `#[warn(clippy::unused_unit)]` on by default | |
warning: unneeded unit return type | |
--> circuits/src/test_utils.rs:32:81 | |
| | |
32 | H: Fn(usize, StarkEvaluationVars<GoldilocksField, GoldilocksField, COL_NUM>) -> (), | |
| ^^^^^^ help: remove the `-> ()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit | |
warning: unneeded unit return type | |
--> circuits/src/test_utils.rs:204:6 | |
| | |
204 | ) -> (), | |
| ^^^^^^ help: remove the `-> ()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit | |
warning: unneeded unit return type | |
--> circuits/src/test_utils.rs:205:81 | |
| | |
205 | H: Fn(usize, StarkEvaluationVars<GoldilocksField, GoldilocksField, COL_NUM>) -> (), | |
| ^^^^^^ help: remove the `-> ()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit | |
warning: unused import: `maybe_rayon::ParallelIterator` | |
--> circuits/src/stark/lookup.rs:13:5 | |
| | |
13 | use maybe_rayon::ParallelIterator; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
warning: unused variable: `init_value_heap_ptr` | |
--> circuits/src/memory/memory_stark.rs:117:13 | |
| | |
117 | let init_value_heap_ptr = P::Scalar::from_canonical_u64(INIT_VALUE_HEAP_PTR); | |
| ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_init_value_heap_ptr` | |
| | |
= note: `#[warn(unused_variables)]` on by default | |
warning: function `get_bitwise_col_name_map` is never used | |
--> circuits/src/builtins/bitwise/columns.rs:79:15 | |
| | |
79 | pub(crate) fn get_bitwise_col_name_map() -> BTreeMap<usize, String> { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: `#[warn(dead_code)]` on by default | |
warning: function `get_cmp_col_name_map` is never used | |
--> circuits/src/builtins/cmp/columns.rs:24:15 | |
| | |
24 | pub(crate) fn get_cmp_col_name_map() -> BTreeMap<usize, String> { | |
| ^^^^^^^^^^^^^^^^^^^^ | |
warning: function `get_storage_access_col_name_map` is never used | |
--> circuits/src/builtins/storage/columns.rs:35:15 | |
| | |
35 | pub(crate) fn get_storage_access_col_name_map() -> BTreeMap<usize, String> { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
warning: function `eval_ext_circuit` is never used | |
--> circuits/src/cpu/call.rs:29:15 | |
| | |
29 | pub(crate) fn eval_ext_circuit<F: RichField + Extendable<D>, const D: usize>( | |
| ^^^^^^^^^^^^^^^^ | |
warning: function `eval_ext_circuit` is never used | |
--> circuits/src/cpu/mload.rs:34:15 | |
| | |
34 | pub(crate) fn eval_ext_circuit<F: RichField + Extendable<D>, const D: usize>( | |
| ^^^^^^^^^^^^^^^^ | |
warning: function `eval_ext_circuit` is never used | |
--> circuits/src/cpu/mov.rs:18:15 | |
| | |
18 | pub(crate) fn eval_ext_circuit<F: RichField + Extendable<D>, const D: usize>( | |
| ^^^^^^^^^^^^^^^^ | |
warning: function `eval_ext_circuit` is never used | |
--> circuits/src/cpu/mstore.rs:35:15 | |
| | |
35 | pub(crate) fn eval_ext_circuit<F: RichField + Extendable<D>, const D: usize>( | |
| ^^^^^^^^^^^^^^^^ | |
warning: function `eval_ext_circuit` is never used | |
--> circuits/src/cpu/ret.rs:29:15 | |
| | |
29 | pub(crate) fn eval_ext_circuit<F: RichField + Extendable<D>, const D: usize>( | |
| ^^^^^^^^^^^^^^^^ | |
warning: function `print_title_data` is never used | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:310:8 | |
| | |
310 | pub fn print_title_data( | |
| ^^^^^^^^^^^^^^^^ | |
warning: function `get_memory_col_name_map` is never used | |
--> circuits/src/memory/columns.rs:47:15 | |
| | |
47 | pub(crate) fn get_memory_col_name_map() -> BTreeMap<usize, String> { | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
warning: function `get_prog_col_name_map` is never used | |
--> circuits/src/program/columns.rs:18:15 | |
| | |
18 | pub(crate) fn get_prog_col_name_map() -> BTreeMap<usize, String> { | |
| ^^^^^^^^^^^^^^^^^^^^^ | |
warning: function `get_prog_chunk_col_name_map` is never used | |
--> circuits/src/program/columns.rs:63:15 | |
| | |
63 | pub(crate) fn get_prog_chunk_col_name_map() -> BTreeMap<usize, String> { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
warning: method `combine_base_circuit` is never used | |
--> circuits/src/stark/permutation.rs:84:19 | |
| | |
73 | impl GrandProductChallenge<Target> { | |
| ---------------------------------- method in this implementation | |
... | |
84 | pub(crate) fn combine_base_circuit<F: RichField + Extendable<D>, const D: usize>( | |
| ^^^^^^^^^^^^^^^^^^^^ | |
warning: function `get_storagehash_extra_looking_products` is never used | |
--> circuits/src/stark/verifier.rs:208:15 | |
| | |
208 | pub(crate) fn get_storagehash_extra_looking_products<F, const D: usize>( | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/bitwise/columns.rs:86:25 | |
| | |
86 | for (index, col) in OP0_LIMBS.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `OP0_LIMBS` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
= note: `#[warn(clippy::useless_conversion)]` on by default | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/bitwise/columns.rs:90:25 | |
| | |
90 | for (index, col) in OP1_LIMBS.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `OP1_LIMBS` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/bitwise/columns.rs:94:25 | |
| | |
94 | for (index, col) in RES_LIMBS.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `RES_LIMBS` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/bitwise/columns.rs:98:25 | |
| | |
98 | for (index, col) in OP0_LIMBS_PERMUTED.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `OP0_LIMBS_PERMUTED` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/bitwise/columns.rs:102:25 | |
| | |
102 | for (index, col) in OP1_LIMBS_PERMUTED.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `OP1_LIMBS_PERMUTED` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/bitwise/columns.rs:106:25 | |
| | |
106 | for (index, col) in RES_LIMBS_PERMUTED.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `RES_LIMBS_PERMUTED` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/bitwise/columns.rs:110:25 | |
| | |
110 | for (index, col) in COMPRESS_LIMBS.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COMPRESS_LIMBS` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/bitwise/columns.rs:114:25 | |
| | |
114 | for (index, col) in COMPRESS_PERMUTED.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COMPRESS_PERMUTED` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/bitwise/columns.rs:119:25 | |
| | |
119 | for (index, col) in FIX_RANGE_CHECK_U8_PERMUTED.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `FIX_RANGE_CHECK_U8_PERMUTED` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/bitwise/columns.rs:128:25 | |
| | |
128 | for (index, col) in FIX_COMPRESS_PERMUTED.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `FIX_COMPRESS_PERMUTED` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:82:25 | |
| | |
82 | for (index, col) in COL_POSEIDON_INPUT_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_POSEIDON_INPUT_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:86:25 | |
| | |
86 | for (index, col) in COL_POSEIDON_OUTPUT_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_POSEIDON_OUTPUT_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:90:25 | |
| | |
90 | for (index, col) in COL_POSEIDON_FULL_ROUND_0_1_STATE_RANGE | |
| _________________________^ | |
91 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_POSEIDON_FULL_ROUND_0_1_STATE_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:97:25 | |
| | |
97 | for (index, col) in COL_POSEIDON_FULL_ROUND_0_2_STATE_RANGE | |
| _________________________^ | |
98 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_POSEIDON_FULL_ROUND_0_2_STATE_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:104:25 | |
| | |
104 | for (index, col) in COL_POSEIDON_FULL_ROUND_0_3_STATE_RANGE | |
| _________________________^ | |
105 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_POSEIDON_FULL_ROUND_0_3_STATE_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:111:25 | |
| | |
111 | for (index, col) in COL_POSEIDON_PARTIAL_ROUND_ELEMENT_RANGE | |
| _________________________^ | |
112 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_POSEIDON_PARTIAL_ROUND_ELEMENT_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:118:25 | |
| | |
118 | for (index, col) in COL_POSEIDON_FULL_ROUND_1_0_STATE_RANGE | |
| _________________________^ | |
119 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_POSEIDON_FULL_ROUND_1_0_STATE_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:125:25 | |
| | |
125 | for (index, col) in COL_POSEIDON_FULL_ROUND_1_1_STATE_RANGE | |
| _________________________^ | |
126 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_POSEIDON_FULL_ROUND_1_1_STATE_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:132:25 | |
| | |
132 | for (index, col) in COL_POSEIDON_FULL_ROUND_1_2_STATE_RANGE | |
| _________________________^ | |
133 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_POSEIDON_FULL_ROUND_1_2_STATE_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:139:25 | |
| | |
139 | for (index, col) in COL_POSEIDON_FULL_ROUND_1_3_STATE_RANGE | |
| _________________________^ | |
140 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_POSEIDON_FULL_ROUND_1_3_STATE_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:159:25 | |
| | |
159 | for (index, col) in COL_POSEIDON_CHUNK_VALUE_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_POSEIDON_CHUNK_VALUE_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:163:25 | |
| | |
163 | for (index, col) in COL_POSEIDON_CHUNK_CAP_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_POSEIDON_CHUNK_CAP_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:167:25 | |
| | |
167 | for (index, col) in COL_POSEIDON_CHUNK_HASH_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_POSEIDON_CHUNK_HASH_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:176:25 | |
| | |
176 | for (index, col) in COL_POSEIDON_CHUNK_IS_FIRST_PADDING_RANGE | |
| _________________________^ | |
177 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_POSEIDON_CHUNK_IS_FIRST_PADDING_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/poseidon/columns.rs:187:25 | |
| | |
187 | for (index, col) in COL_POSEIDON_CHUNK_FILTER_LOOKING_MEM_RANGE | |
| _________________________^ | |
188 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_POSEIDON_CHUNK_FILTER_LOOKING_MEM_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: manual implementation of an assign operation | |
--> circuits/src/builtins/poseidon/poseidon_chunk_stark.rs:168:17 | |
| | |
168 | *s = *s + v; | |
| ^^^^^^^^^^^ help: replace it with: `*s += v` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern | |
= note: `#[warn(clippy::assign_op_pattern)]` on by default | |
warning: manual implementation of an assign operation | |
--> circuits/src/builtins/poseidon/poseidon_chunk_stark.rs:178:17 | |
| | |
178 | *s = *s + v; | |
| ^^^^^^^^^^^ help: replace it with: `*s += v` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern | |
warning: the loop variable `i` is used to index `state` | |
--> circuits/src/builtins/poseidon/poseidon_stark.rs:92:26 | |
| | |
92 | for i in 0..POSEIDON_STATE_WIDTH { | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
= note: `#[warn(clippy::needless_range_loop)]` on by default | |
help: consider using an iterator and enumerate() | |
| | |
92 | for (i, <item>) in state.iter_mut().enumerate().take(POSEIDON_STATE_WIDTH) { | |
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: the loop variable `i` is used to index `state` | |
--> circuits/src/builtins/poseidon/poseidon_stark.rs:123:22 | |
| | |
123 | for i in 0..POSEIDON_STATE_WIDTH { | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator and enumerate() | |
| | |
123 | for (i, <item>) in state.iter_mut().enumerate().take(POSEIDON_STATE_WIDTH) { | |
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: the loop variable `i` is used to index `state` | |
--> circuits/src/builtins/poseidon/poseidon_stark.rs:133:18 | |
| | |
133 | for i in 0..POSEIDON_STATE_WIDTH { | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator and enumerate() | |
| | |
133 | for (i, <item>) in state.iter().enumerate().take(POSEIDON_STATE_WIDTH) { | |
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/sccall/columns.rs:25:25 | |
| | |
25 | for (index, col) in COL_SCCALL_CALLER_EXE_CTX_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_SCCALL_CALLER_EXE_CTX_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/sccall/columns.rs:29:25 | |
| | |
29 | for (index, col) in COL_SCCALL_CALLER_CODE_CTX_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_SCCALL_CALLER_CODE_CTX_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/sccall/columns.rs:36:25 | |
| | |
36 | for (index, col) in COL_SCCALL_CALLER_REG_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_SCCALL_CALLER_REG_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` | |
--> circuits/src/builtins/sccall/sccall_stark.rs:36:21 | |
| | |
36 | Column::singles(res.into_iter()).collect_vec() | |
| ^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `res` | |
| | |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` | |
--> circuits/src/stark/cross_table_lookup.rs:42:23 | |
| | |
42 | pub fn singles<I: IntoIterator<Item = impl Borrow<usize>>>( | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` | |
--> circuits/src/builtins/sccall/sccall_stark.rs:56:21 | |
| | |
56 | Column::singles(res.into_iter()).collect_vec() | |
| ^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `res` | |
| | |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` | |
--> circuits/src/stark/cross_table_lookup.rs:42:23 | |
| | |
42 | pub fn singles<I: IntoIterator<Item = impl Borrow<usize>>>( | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/storage/columns.rs:38:25 | |
| | |
38 | for (index, col) in COL_ST_PRE_ROOT_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_ST_PRE_ROOT_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/storage/columns.rs:42:25 | |
| | |
42 | for (index, col) in COL_ST_ROOT_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_ST_ROOT_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/storage/columns.rs:50:25 | |
| | |
50 | for (index, col) in COL_ST_ADDR_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_ST_ADDR_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/storage/columns.rs:54:25 | |
| | |
54 | for (index, col) in COL_ST_PRE_PATH_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_ST_PRE_PATH_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/storage/columns.rs:58:25 | |
| | |
58 | for (index, col) in COL_ST_PATH_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_ST_PATH_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/storage/columns.rs:62:25 | |
| | |
62 | for (index, col) in COL_ST_SIB_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_ST_SIB_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/storage/columns.rs:67:25 | |
| | |
67 | for (index, col) in COL_ST_PRE_HASH_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_ST_PRE_HASH_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/builtins/storage/columns.rs:71:25 | |
| | |
71 | for (index, col) in COL_ST_HASH_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_ST_HASH_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/cpu/columns.rs:141:25 | |
| | |
141 | for (index, col) in COL_ADDR_STORAGE_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_ADDR_STORAGE_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/cpu/columns.rs:145:25 | |
| | |
145 | for (index, col) in COL_ADDR_CODE_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_ADDR_CODE_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/cpu/columns.rs:154:25 | |
| | |
154 | for (index, col) in COL_REGS.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_REGS` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/cpu/columns.rs:168:25 | |
| | |
168 | for (index, col) in COL_S_OP0.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_S_OP0` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/cpu/columns.rs:172:25 | |
| | |
172 | for (index, col) in COL_S_OP1.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_S_OP1` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/cpu/columns.rs:176:25 | |
| | |
176 | for (index, col) in COL_S_DST.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_S_DST` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` | |
--> circuits/src/cpu/cpu_stark.rs:264:21 | |
| | |
264 | Column::singles(res.into_iter()).collect_vec() | |
| ^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `res` | |
| | |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` | |
--> circuits/src/stark/cross_table_lookup.rs:42:23 | |
| | |
42 | pub fn singles<I: IntoIterator<Item = impl Borrow<usize>>>( | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: using `clone` on type `F` which implements the `Copy` trait | |
--> circuits/src/generation/builtin.rs:284:28 | |
| | |
284 | let append_value = trace[rangecheck::FIX_RANGE_CHECK_U16] | |
| ____________________________^ | |
285 | | .last() | |
286 | | .unwrap() | |
287 | | .clone(); | |
| |____________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
= note: `#[warn(clippy::clone_on_copy)]` on by default | |
help: try dereferencing it | |
| | |
284 ~ let append_value = *trace[rangecheck::FIX_RANGE_CHECK_U16] | |
285 + .last() | |
286 ~ .unwrap(); | |
| | |
warning: using `clone` on type `F` which implements the `Copy` trait | |
--> circuits/src/generation/builtin.rs:289:57 | |
| | |
289 | trace[rangecheck::FIX_RANGE_CHECK_U16].push(append_value.clone()); | |
| ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `append_value` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: returning the result of a `let` binding from a block | |
--> circuits/src/generation/cpu.rs:217:5 | |
| | |
210 | / let trace_row_vecs = trace.try_into().unwrap_or_else(|v: Vec<Vec<F>>| { | |
211 | | panic!( | |
212 | | "Expected a Vec of length {} but it was {}", | |
213 | | cpu::NUM_CPU_COLS, | |
214 | | v.len() | |
215 | | ) | |
216 | | }); | |
| |_______- unnecessary `let` binding | |
217 | trace_row_vecs | |
| ^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
= note: `#[warn(clippy::let_and_return)]` on by default | |
help: return the expression directly | |
| | |
210 ~ | |
211 ~ trace.try_into().unwrap_or_else(|v: Vec<Vec<F>>| { | |
212 + panic!( | |
213 + "Expected a Vec of length {} but it was {}", | |
214 + cpu::NUM_CPU_COLS, | |
215 + v.len() | |
216 + ) | |
217 + }) | |
| | |
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` | |
--> circuits/src/generation/cpu.rs:108:9 | |
| | |
108 | / match opcode_to_selector.get(&s.opcode.0) { | |
109 | | Some(selector) => trace[selector.clone()][i] = F::from_canonical_u64(1), | |
110 | | None => (), | |
111 | | } | |
| |_________^ help: try: `if let Some(selector) = opcode_to_selector.get(&s.opcode.0) { trace[selector.clone()][i] = F::from_canonical_u64(1) }` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match | |
= note: `#[warn(clippy::single_match)]` on by default | |
warning: using `clone` on type `usize` which implements the `Copy` trait | |
--> circuits/src/generation/cpu.rs:109:37 | |
| | |
109 | Some(selector) => trace[selector.clone()][i] = F::from_canonical_u64(1), | |
| ^^^^^^^^^^^^^^^^ help: try dereferencing it: `(*selector)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
error: this `if` has identical blocks | |
--> circuits/src/generation/cpu.rs:172:9 | |
| | |
172 | / { | |
173 | | F::ONE | |
174 | | } else if s.op1_imm.0 == 1 { | |
| |_________^ | |
| | |
note: same as this | |
--> circuits/src/generation/cpu.rs:174:36 | |
| | |
174 | } else if s.op1_imm.0 == 1 { | |
| ____________________________________^ | |
175 | | F::ONE | |
176 | | } else { | |
| |_________^ | |
= 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 | |
warning: very complex type used. Consider factoring parts into `type` definitions | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:41:6 | |
| | |
41 | ) -> ( | |
| ______^ | |
42 | | [String; DATA_SIZE], | |
43 | | Vec<[GoldilocksField; DATA_SIZE]>, | |
44 | | [String; DATA_SIZE], | |
45 | | Vec<[GoldilocksField; DATA_SIZE]>, | |
46 | | ) { | |
| |_^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity | |
= note: `#[warn(clippy::type_complexity)]` on by default | |
warning: this function has too many arguments (8/7) | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:28:1 | |
| | |
28 | / fn get_looking_looked_info< | |
29 | | const LOOKING_COL_NUM: usize, | |
30 | | const LOOKED_COL_NUM: usize, | |
31 | | const DATA_SIZE: usize, | |
... | | |
45 | | Vec<[GoldilocksField; DATA_SIZE]>, | |
46 | | ) { | |
| |_^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
= note: `#[warn(clippy::too_many_arguments)]` on by default | |
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:71:10 | |
| | |
71 | .into_iter() | |
| ^^^^^^^^^ help: call directly: `iter` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref | |
= note: `#[warn(clippy::into_iter_on_ref)]` on by default | |
warning: deref which would be done by auto-deref | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:72:34 | |
| | |
72 | .filter(|row| row_filter(*row)) | |
| ^^^^ help: try: `row` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref | |
= note: `#[warn(clippy::explicit_auto_deref)]` on by default | |
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:100:10 | |
| | |
100 | .into_iter() | |
| ^^^^^^^^^ help: call directly: `iter` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref | |
warning: deref which would be done by auto-deref | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:101:34 | |
| | |
101 | .filter(|row| row_filter(*row, filter_offset)) | |
| ^^^^ help: try: `row` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref | |
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:132:10 | |
| | |
132 | .into_iter() | |
| ^^^^^^^^^ help: call directly: `iter` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref | |
warning: deref which would be done by auto-deref | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:133:30 | |
| | |
133 | .filter(|row| filter(*row, filter_offset)) | |
| ^^^^ help: try: `row` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref | |
warning: unneeded `return` statement | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:259:5 | |
| | |
259 | return program.trace; | |
| ^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
= note: `#[warn(clippy::needless_return)]` on by default | |
help: remove `return` | |
| | |
259 - return program.trace; | |
259 + program.trace | |
| | |
warning: single-character string constant used as pattern | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:174:47 | |
| | |
174 | let instructions = program.bytecode.split("\n"); | |
| ^^^^ help: try using a `char` instead: `'\n'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
= note: `#[warn(clippy::single_char_pattern)]` on by default | |
warning: the loop variable `j` is only used to index `cols` | |
--> circuits/src/generation/ctl_test/debug_trace_print.rs:286:18 | |
| | |
286 | for j in 0..COL_NUM { | |
| ^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator | |
| | |
286 | for <item> in cols.iter().take(COL_NUM) { | |
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` | |
--> circuits/src/generation/memory.rs:58:9 | |
| | |
58 | / match opcode_to_selector.get(&c.op.0) { | |
59 | | Some(selector) => trace[selector.clone()][i] = F::from_canonical_u64(1), | |
60 | | None => (), | |
61 | | } | |
| |_________^ help: try: `if let Some(selector) = opcode_to_selector.get(&c.op.0) { trace[selector.clone()][i] = F::from_canonical_u64(1) }` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match | |
warning: using `clone` on type `usize` which implements the `Copy` trait | |
--> circuits/src/generation/memory.rs:59:37 | |
| | |
59 | Some(selector) => trace[selector.clone()][i] = F::from_canonical_u64(1), | |
| ^^^^^^^^^^^^^^^^ help: try dereferencing it: `(*selector)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
error: this `if` has identical blocks | |
--> circuits/src/generation/memory.rs:79:65 | |
| | |
79 | trace[memory::COL_MEM_FILTER_LOOKING_RC][i] = if i == 0 { | |
| _________________________________________________________________^ | |
80 | | F::from_canonical_u64(0) | |
81 | | } else if c.region_prophet.to_canonical_u64() == 1 { | |
| |_________^ | |
| | |
note: same as this | |
--> circuits/src/generation/memory.rs:81:60 | |
| | |
81 | } else if c.region_prophet.to_canonical_u64() == 1 { | |
| ____________________________________________________________^ | |
82 | | F::from_canonical_u64(0) | |
83 | | } else if curr_is_heap && last_is_not_heap { | |
| |_________^ | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else | |
error: this `if` has identical blocks | |
--> circuits/src/generation/memory.rs:81:60 | |
| | |
81 | } else if c.region_prophet.to_canonical_u64() == 1 { | |
| ____________________________________________________________^ | |
82 | | F::from_canonical_u64(0) | |
83 | | } else if curr_is_heap && last_is_not_heap { | |
| |_________^ | |
| | |
note: same as this | |
--> circuits/src/generation/memory.rs:83:52 | |
| | |
83 | } else if curr_is_heap && last_is_not_heap { | |
| ____________________________________________________^ | |
84 | | F::from_canonical_u64(0) | |
85 | | } else { | |
| |_________^ | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else | |
warning: using `clone` on type `[GoldilocksField; 4]` which implements the `Copy` trait | |
--> circuits/src/generation/prog.rs:176:25 | |
| | |
176 | addr.clone(), | |
| ^^^^^^^^^^^^ help: try removing the `clone` call: `addr` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:83:16 | |
| | |
83 | let exec = std::mem::replace(&mut program.trace.exec, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.exec)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
= note: `#[warn(clippy::mem_replace_with_default)]` on by default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:91:18 | |
| | |
91 | let memory = std::mem::replace(&mut program.trace.memory, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.memory)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:99:9 | |
| | |
99 | std::mem::replace(&mut program.trace.builtin_bitwise_combined, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.builtin_bitwise_combined)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:106:23 | |
| | |
106 | let builtin_cmp = std::mem::replace(&mut program.trace.builtin_cmp, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.builtin_cmp)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:113:30 | |
| | |
113 | let builtin_rangecheck = std::mem::replace(&mut program.trace.builtin_rangecheck, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.builtin_rangecheck)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:120:28 | |
| | |
120 | let builtin_poseidon = std::mem::replace(&mut program.trace.builtin_poseidon, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.builtin_poseidon)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:128:9 | |
| | |
128 | std::mem::replace(&mut program.trace.builtin_poseidon_chunk, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.builtin_poseidon_chunk)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:137:9 | |
| | |
137 | std::mem::replace(&mut program.trace.builtin_storage_hash, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.builtin_storage_hash)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:139:9 | |
| | |
139 | std::mem::replace(&mut program.trace.builtin_program_hash, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.builtin_program_hash)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:147:16 | |
| | |
147 | let tape = std::mem::replace(&mut program.trace.tape, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.tape)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` | |
--> circuits/src/generation/mod.rs:154:19 | |
| | |
154 | let sc_call = std::mem::replace(&mut program.trace.sc_call, Vec::new()); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut program.trace.sc_call)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/program/columns.rs:20:25 | |
| | |
20 | for (index, col) in COL_PROG_CODE_ADDR_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_PROG_CODE_ADDR_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/program/columns.rs:28:25 | |
| | |
28 | for (index, col) in COL_PROG_EXEC_CODE_ADDR_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_PROG_EXEC_CODE_ADDR_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/program/columns.rs:65:25 | |
| | |
65 | for (index, col) in COL_PROG_CHUNK_CODE_ADDR_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_PROG_CHUNK_CODE_ADDR_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/program/columns.rs:70:25 | |
| | |
70 | for (index, col) in COL_PROG_CHUNK_INST_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_PROG_CHUNK_INST_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/program/columns.rs:74:25 | |
| | |
74 | for (index, col) in COL_PROG_CHUNK_CAP_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_PROG_CHUNK_CAP_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/program/columns.rs:78:25 | |
| | |
78 | for (index, col) in COL_PROG_CHUNK_HASH_RANGE.into_iter().enumerate() { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `COL_PROG_CHUNK_HASH_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/program/columns.rs:87:25 | |
| | |
87 | for (index, col) in COL_PROG_CHUNK_FILTER_LOOKING_PROG_RANGE | |
| _________________________^ | |
88 | | .into_iter() | |
| |____________________^ help: consider removing `.into_iter()`: `COL_PROG_CHUNK_FILTER_LOOKING_PROG_RANGE` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: type parameter `C` goes unused in function definition | |
--> circuits/src/stark/cross_table_lookup.rs:380:56 | |
| | |
380 | pub(crate) fn eval_cross_table_lookup_checks<F, FE, P, C, S, const D: usize, const D2: usize>( | |
| ^ | |
| | |
= help: consider removing the parameter | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
= note: `#[warn(clippy::extra_unused_type_parameters)]` on by default | |
warning: type parameter `C` goes unused in function definition | |
--> circuits/src/stark/cross_table_lookup.rs:553:5 | |
| | |
553 | / C: GenericConfig<D, F = F>, | |
554 | | const D: usize, | |
| |____^ help: consider removing the parameter | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
warning: the loop variable `c` is only used to index `extra_product_vec` | |
--> circuits/src/stark/cross_table_lookup.rs:568:18 | |
| | |
568 | for c in 0..config.num_challenges { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator | |
| | |
568 | for <item> in extra_product_vec.iter().take(config.num_challenges) { | |
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: type parameter `C` goes unused in function definition | |
--> circuits/src/stark/cross_table_lookup.rs:589:5 | |
| | |
589 | / C: GenericConfig<D, F = F>, | |
590 | | const D: usize, | |
| |____^ help: consider removing the parameter | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
warning: the loop variable `c` is only used to index `extra_product_vec` | |
--> circuits/src/stark/cross_table_lookup.rs:605:18 | |
| | |
605 | for c in 0..inner_config.num_challenges { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop | |
help: consider using an iterator | |
| | |
605 | for <item> in extra_product_vec.iter().take(inner_config.num_challenges) { | |
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
warning: type parameter `C` goes unused in function definition | |
--> circuits/src/stark/permutation.rs:102:46 | |
| | |
102 | pub(crate) fn compute_permutation_z_polys<F, C, S, const D: usize>( | |
| ^ | |
| | |
= help: consider removing the parameter | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
warning: type parameter `C` goes unused in function definition | |
--> circuits/src/stark/permutation.rs:301:49 | |
| | |
301 | pub(crate) fn eval_permutation_checks<F, FE, P, C, S, const D: usize, const D2: usize>( | |
| ^ | |
| | |
= help: consider removing the parameter | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
warning: this function has too many arguments (8/7) | |
--> circuits/src/stark/prover.rs:333:1 | |
| | |
333 | / pub(crate) fn prove_single_table<F, C, S, const D: usize>( | |
334 | | stark: &S, | |
335 | | config: &StarkConfig, | |
336 | | trace_poly_values: &[PolynomialValues<F>], | |
... | | |
341 | | twiddle_map: &mut BTreeMap<usize, Vec<F>>, | |
342 | | ) -> Result<StarkProof<F, C, D>> | |
| |________________________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: this function has too many arguments (9/7) | |
--> circuits/src/stark/prover.rs:574:1 | |
| | |
574 | / fn compute_quotient_polys<'a, F, P, C, S, const D: usize>( | |
575 | | stark: &S, | |
576 | | trace_commitment: &'a PolynomialBatch<F, C, D>, | |
577 | | permutation_ctl_zs_commitment: &'a PolynomialBatch<F, C, D>, | |
... | | |
583 | | config: &StarkConfig, | |
584 | | ) -> Vec<PolynomialCoeffs<F>> | |
| |_____________________________^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: useless conversion to the same type: `std::ops::Range<usize>` | |
--> circuits/src/stark/prover.rs:695:13 | |
| | |
695 | (0..P::WIDTH).into_iter().map(move |i| { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..P::WIDTH)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion | |
warning: this function has too many arguments (9/7) | |
--> circuits/src/stark/prover.rs:714:1 | |
| | |
714 | / fn check_constraints<'a, F, C, S, const D: usize>( | |
715 | | stark: &S, | |
716 | | trace_commitment: &'a PolynomialBatch<F, C, D>, | |
717 | | permutation_ctl_zs_commitment: &'a PolynomialBatch<F, C, D>, | |
... | | |
723 | | config: &StarkConfig, | |
724 | | ) where | |
| |_^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments | |
warning: struct `Buffer` has a public `len` method, but no `is_empty` method | |
--> circuits/src/stark/serialization.rs:24:5 | |
| | |
24 | pub fn len(&self) -> usize { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty | |
= note: `#[warn(clippy::len_without_is_empty)]` on by default | |
warning: module has the same name as its containing module | |
--> circuits/src/stark/mod.rs:11:1 | |
| | |
11 | pub mod stark; | |
| ^^^^^^^^^^^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception | |
= note: `#[warn(clippy::module_inception)]` on by default | |
warning: type parameter `C` goes unused in function definition | |
--> circuits/src/stark/vanishing_poly.rs:48:46 | |
| | |
48 | pub(crate) fn eval_vanishing_poly_circuit<F, C, S, const D: usize>( | |
| ^ | |
| | |
= help: consider removing the parameter | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters | |
warning: returning the result of a `let` binding from a block | |
--> circuits/src/stark/verifier.rs:216:5 | |
| | |
215 | let prod = F::ONE; | |
| ------------------ unnecessary `let` binding | |
216 | prod | |
| ^^^^ | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return | |
help: return the expression directly | |
| | |
215 ~ | |
216 ~ F::ONE | |
| | |
warning: single-character string constant used as pattern | |
--> circuits/src/test_utils.rs:46:47 | |
| | |
46 | let instructions = program.bytecode.split("\n"); | |
| ^^^^ help: try using a `char` instead: `'\n'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` | |
--> circuits/src/test_utils.rs:183:17 | |
| | |
183 | / match error_hook { | |
184 | | Some(ref hook) => hook(i, vars), | |
185 | | None => {} | |
186 | | } | |
| |_________________^ help: try: `if let Some(ref hook) = error_hook { hook(i, vars) }` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match | |
warning: single-character string constant used as pattern | |
--> circuits/src/test_utils.rs:219:47 | |
| | |
219 | let instructions = program.bytecode.split("\n"); | |
| ^^^^ help: try using a `char` instead: `'\n'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` | |
--> circuits/src/test_utils.rs:357:17 | |
| | |
357 | / match error_hook { | |
358 | | Some(ref hook) => hook(i, vars), | |
359 | | None => {} | |
360 | | } | |
| |_________________^ help: try: `if let Some(ref hook) = error_hook { hook(i, vars) }` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:87:9 | |
| | |
87 | cpu_tx.send(trace_to_poly_values(cpu_rows)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
= note: `#[warn(unused_must_use)]` on by default | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
87 | let _ = cpu_tx.send(trace_to_poly_values(cpu_rows)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:94:9 | |
| | |
94 | memory_tx.send(trace_to_poly_values(memory_rows)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
94 | let _ = memory_tx.send(trace_to_poly_values(memory_rows)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:102:9 | |
| | |
102 | bitwise_tx.send((trace_to_poly_values(bitwise_rows), bitwise_beta)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
102 | let _ = bitwise_tx.send((trace_to_poly_values(bitwise_rows), bitwise_beta)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:109:9 | |
| | |
109 | cmp_tx.send(trace_to_poly_values(cmp_rows)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
109 | let _ = cmp_tx.send(trace_to_poly_values(cmp_rows)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:116:9 | |
| | |
116 | rc_tx.send(trace_to_poly_values(rc_rows)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
116 | let _ = rc_tx.send(trace_to_poly_values(rc_rows)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:123:9 | |
| | |
123 | poseidon_tx.send(trace_to_poly_values(poseidon_rows)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
123 | let _ = poseidon_tx.send(trace_to_poly_values(poseidon_rows)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:132:9 | |
| | |
132 | poseidon_chunk_tx.send(trace_to_poly_values(poseidon_chunk_rows)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
132 | let _ = poseidon_chunk_tx.send(trace_to_poly_values(poseidon_chunk_rows)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:143:9 | |
| | |
143 | storage_tx.send(trace_to_poly_values(storage_access_rows)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
143 | let _ = storage_tx.send(trace_to_poly_values(storage_access_rows)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:150:9 | |
| | |
150 | tape_tx.send(trace_to_poly_values(tape_rows)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
150 | let _ = tape_tx.send(trace_to_poly_values(tape_rows)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:157:9 | |
| | |
157 | sccall_tx.send(trace_to_poly_values(sccall_rows)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
157 | let _ = sccall_tx.send(trace_to_poly_values(sccall_rows)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:171:9 | |
| | |
171 | program_tx.send((trace_to_poly_values(program_rows), program_beta)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
171 | let _ = program_tx.send((trace_to_poly_values(program_rows), program_beta)); | |
| +++++++ | |
warning: unused `std::result::Result` that must be used | |
--> circuits/src/generation/mod.rs:177:9 | |
| | |
177 | prog_chunk_tx.send(trace_to_poly_values(prog_chunk_rows)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this `Result` may be an `Err` variant, which should be handled | |
help: use `let _ = ...` to ignore the resulting value | |
| | |
177 | let _ = prog_chunk_tx.send(trace_to_poly_values(prog_chunk_rows)); | |
| +++++++ | |
warning: `circuits` (lib) generated 156 warnings | |
error: could not compile `circuits` (lib) due to 3 previous errors; 156 warnings emitted | |
~/m/p/o/olavm (main)$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment