diff --git a/src/cli/field_data.rs b/src/cli/field_data.rs index 04a4c44f96..ee8afd4ef0 100644 --- a/src/cli/field_data.rs +++ b/src/cli/field_data.rs @@ -83,7 +83,7 @@ mod tests { use super::{de, ser, HasFieldModulus}; #[derive(PartialEq, Debug, Clone, Serialize, Deserialize)] - struct Struct { + struct Struct { str: String, int: i32, ff: F, diff --git a/src/coprocessor/circom.rs b/src/coprocessor/circom.rs index 49a7aeb0d5..218647d734 100644 --- a/src/coprocessor/circom.rs +++ b/src/coprocessor/circom.rs @@ -86,7 +86,7 @@ Then run `lurk coprocessor --name {name} <{}_FOLDER>` to instantiate a new gadge /// } /// ``` #[derive(Debug)] - pub struct CircomCoprocessor> { + pub struct CircomCoprocessor { gadget: C, config: CircomConfig, } diff --git a/src/coprocessor/mod.rs b/src/coprocessor/mod.rs index a3be4afd8f..abcdd1b903 100644 --- a/src/coprocessor/mod.rs +++ b/src/coprocessor/mod.rs @@ -119,7 +119,7 @@ pub(crate) mod test { /// A dumb Coprocessor for testing. #[derive(Clone, Debug, Serialize, Deserialize)] - pub(crate) struct DumbCoprocessor { + pub(crate) struct DumbCoprocessor { pub(crate) _p: PhantomData, } @@ -235,7 +235,7 @@ pub(crate) mod test { /// A coprocessor that simply halts the CEK machine, for testing purposes #[derive(Clone, Debug, Serialize, Deserialize)] - pub(crate) struct Terminator { + pub(crate) struct Terminator { _p: PhantomData, } diff --git a/src/coprocessor/trie/mod.rs b/src/coprocessor/trie/mod.rs index 899b06f43a..8db6e07a11 100644 --- a/src/coprocessor/trie/mod.rs +++ b/src/coprocessor/trie/mod.rs @@ -58,7 +58,7 @@ pub enum TrieCoproc { } #[derive(Clone, Debug, Serialize, Default, Deserialize)] -pub struct NewCoprocessor { +pub struct NewCoprocessor { _p: PhantomData, } @@ -104,7 +104,7 @@ impl CoCircuit for NewCoprocessor { } #[derive(Clone, Debug, Serialize, Default, Deserialize)] -pub struct LookupCoprocessor { +pub struct LookupCoprocessor { _p: PhantomData, } @@ -208,7 +208,7 @@ impl CoCircuit for LookupCoprocessor { } #[derive(Clone, Debug, Serialize, Default, Deserialize)] -pub struct InsertCoprocessor { +pub struct InsertCoprocessor { _p: PhantomData, } diff --git a/src/eval/lang.rs b/src/eval/lang.rs index 5c56722a06..81195f67a6 100644 --- a/src/eval/lang.rs +++ b/src/eval/lang.rs @@ -19,7 +19,7 @@ use crate::{ /// This struct is an example of a coprocessor implementation that would extend the [`crate::coprocessor::Coprocessor`] trait. /// More implementations can be added without modifying the existing code, adhering to the open-closed principle. #[derive(Clone, Debug, Deserialize, Serialize)] -pub struct DummyCoprocessor { +pub struct DummyCoprocessor { pub(crate) _p: PhantomData, } @@ -38,7 +38,7 @@ impl Coprocessor for DummyCoprocessor { impl CoCircuit for DummyCoprocessor {} -impl DummyCoprocessor { +impl DummyCoprocessor { #[allow(dead_code)] pub(crate) fn new() -> Self { Self { @@ -73,13 +73,13 @@ pub enum Coproc { /// // TODO: Define a trait for the Hash and parameterize on that also. #[derive(Debug, Default, Clone, Deserialize, Serialize)] -pub struct Lang> { +pub struct Lang { /// An IndexMap that stores coprocessors with their associated `Sym` keys. coprocessors: IndexMap, _p: PhantomData, } -impl> Lang { +impl Lang { #[inline] pub fn new() -> Self { Self { @@ -154,7 +154,7 @@ impl> Lang { /// A `Binding` associates a name (`Sym`) and `Coprocessor`. It facilitates modular construction of `Lang`s using /// `Coprocessor`s. #[derive(Debug)] -pub struct Binding> { +pub struct Binding { name: Symbol, coproc: C, _p: PhantomData, @@ -166,7 +166,7 @@ impl, S: Into> From<(S, C)> for Binding< } } -impl> Binding { +impl Binding { pub fn new, S: Into>(name: S, coproc: T) -> Self { Self { name: name.into(), diff --git a/src/eval/mod.rs b/src/eval/mod.rs index e6179f155b..7b53802e44 100644 --- a/src/eval/mod.rs +++ b/src/eval/mod.rs @@ -1,12 +1,10 @@ -use crate::field::LurkField; - use std::cmp::PartialEq; use std::marker::PhantomData; pub mod lang; #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub struct Frame { +pub struct Frame { pub input: T, pub output: T, pub i: usize, diff --git a/src/field.rs b/src/field.rs index 217ed3e20c..c2d5f833bb 100644 --- a/src/field.rs +++ b/src/field.rs @@ -282,7 +282,7 @@ impl LurkField for GrumpkinScalar { // For working around the orphan trait impl rule /// Wrapper struct around a field element that implements additional traits #[derive(Clone, Debug, PartialEq, Eq)] -pub struct FWrap(pub F); +pub struct FWrap(pub F); impl Copy for FWrap {} diff --git a/src/lem/circuit.rs b/src/lem/circuit.rs index 155545e345..ee3cc345f3 100644 --- a/src/lem/circuit.rs +++ b/src/lem/circuit.rs @@ -467,7 +467,7 @@ impl Block { } } -struct RecursiveContext<'a, F: LurkField, C: Coprocessor> { +struct RecursiveContext<'a, F: LurkField, C> { lang: &'a Lang, store: &'a Store, global_allocator: &'a GlobalAllocator, diff --git a/src/lem/eval.rs b/src/lem/eval.rs index ea5d8e8e24..f172d56f63 100644 --- a/src/lem/eval.rs +++ b/src/lem/eval.rs @@ -232,12 +232,12 @@ pub fn evaluate_simple>( evaluate_simple_with_env(lang_setup, expr, store.intern_nil(), store, limit) } -pub struct EvalConfig<'a, F: LurkField, C: Coprocessor> { +pub struct EvalConfig<'a, F, C> { lang: &'a Lang, folding_mode: FoldingMode, } -impl<'a, F: LurkField, C: Coprocessor> EvalConfig<'a, F, C> { +impl<'a, F, C> EvalConfig<'a, F, C> { #[inline] pub fn new_ivc(lang: &'a Lang) -> Self { Self { diff --git a/src/parser/error.rs b/src/parser/error.rs index 8e83481594..4abfcc65aa 100644 --- a/src/parser/error.rs +++ b/src/parser/error.rs @@ -121,7 +121,6 @@ impl<'a, F: LurkField> fmt::Display for ParseError, F> { impl nom::error::ParseError for ParseError where I: InputLength, - I: Clone, { fn from_error_kind(input: I, kind: ErrorKind) -> Self { ParseError::new(input, ParseErrorKind::Nom(kind)) @@ -155,7 +154,6 @@ where impl nom::error::ContextError for ParseError where I: InputLength, - I: Clone, { fn add_context(input: I, ctx: &'static str, other: Self) -> Self { match input.input_len().cmp(&other.input.input_len()) {