Skip to content

Commit 9710587

Browse files
committed
Lint: fix all warnings for Rust 1.84
1 parent ea25ce9 commit 9710587

File tree

43 files changed

+118
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+118
-95
lines changed

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ members = [
2828
]
2929
resolver = "2"
3030

31+
# Ignore non-local impl warnings from OCaml derive macros in nested contexts
32+
# See: https://github.com/o1-labs/proof-systems/issues/3319
33+
[workspace.lints.rust]
34+
non_local_definitions = "allow"
35+
3136
[workspace.dependencies]
3237
ark-algebra-test-templates = "0.5"
3338
ark-bn254 = { version = "0.5" }

arrabbiata/src/challenge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,6 @@ impl<F> Index<ChallengeTerm> for Challenges<F> {
142142
}
143143
}
144144

145-
impl<'a> AlphaChallengeTerm<'a> for ChallengeTerm {
145+
impl AlphaChallengeTerm<'_> for ChallengeTerm {
146146
const ALPHA: Self = Self::ConstraintCombiner;
147147
}

curves/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ readme = "../README.md"
99
edition = "2021"
1010
license = "Apache-2.0"
1111

12+
[features]
13+
asm = ["ark-ff/asm"]
14+
1215
[dependencies]
1316
ark-bn254.workspace = true
1417
ark-ec.workspace = true

folding/src/eval_leaf.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub enum EvalLeaf<'a, F> {
66
Result(Vec<F>),
77
}
88

9-
impl<'a, F: core::fmt::Display> core::fmt::Display for EvalLeaf<'a, F> {
9+
impl<F: core::fmt::Display> core::fmt::Display for EvalLeaf<'_, F> {
1010
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1111
let slice = match self {
1212
EvalLeaf::Const(c) => {
@@ -25,39 +25,39 @@ impl<'a, F: core::fmt::Display> core::fmt::Display for EvalLeaf<'a, F> {
2525
}
2626
}
2727

28-
impl<'a, F: core::ops::Add<Output = F> + Clone> core::ops::Add for EvalLeaf<'a, F> {
28+
impl<F: core::ops::Add<Output = F> + Clone> core::ops::Add for EvalLeaf<'_, F> {
2929
type Output = Self;
3030

3131
fn add(self, rhs: Self) -> Self {
3232
Self::bin_op(|a, b| a + b, self, rhs)
3333
}
3434
}
3535

36-
impl<'a, F: core::ops::Sub<Output = F> + Clone> core::ops::Sub for EvalLeaf<'a, F> {
36+
impl<F: core::ops::Sub<Output = F> + Clone> core::ops::Sub for EvalLeaf<'_, F> {
3737
type Output = Self;
3838

3939
fn sub(self, rhs: Self) -> Self {
4040
Self::bin_op(|a, b| a - b, self, rhs)
4141
}
4242
}
4343

44-
impl<'a, F: core::ops::Mul<Output = F> + Clone> core::ops::Mul for EvalLeaf<'a, F> {
44+
impl<F: core::ops::Mul<Output = F> + Clone> core::ops::Mul for EvalLeaf<'_, F> {
4545
type Output = Self;
4646

4747
fn mul(self, rhs: Self) -> Self {
4848
Self::bin_op(|a, b| a * b, self, rhs)
4949
}
5050
}
5151

52-
impl<'a, F: core::ops::Mul<Output = F> + Clone> core::ops::Mul<F> for EvalLeaf<'a, F> {
52+
impl<F: core::ops::Mul<Output = F> + Clone> core::ops::Mul<F> for EvalLeaf<'_, F> {
5353
type Output = Self;
5454

5555
fn mul(self, rhs: F) -> Self {
5656
self * Self::Const(rhs)
5757
}
5858
}
5959

60-
impl<'a, F: Clone> EvalLeaf<'a, F> {
60+
impl<F: Clone> EvalLeaf<'_, F> {
6161
pub fn map<M: Fn(&F) -> F, I: Fn(&mut F)>(self, map: M, in_place: I) -> Self {
6262
use EvalLeaf::*;
6363
match self {

internal-tracing/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66

7+
[lints]
8+
workspace = true
9+
710
[dependencies]
811
ocaml = { workspace = true, optional = true }
912
ocaml-gen = { workspace = true, optional = true }

ivc/tests/simple.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,26 @@ impl ColumnIndexer<usize> for AdditionColumn {
8080
}
8181
}
8282

83+
impl FoldingColumnTrait for AdditionColumn {
84+
fn is_witness(&self) -> bool {
85+
true
86+
}
87+
}
88+
89+
impl<const N_COL: usize, const N_FSEL: usize> Index<AdditionColumn>
90+
for PlonkishWitness<N_COL, N_FSEL, Fp>
91+
{
92+
type Output = [Fp];
93+
94+
fn index(&self, index: AdditionColumn) -> &Self::Output {
95+
match index {
96+
AdditionColumn::A => &self.witness.cols[0].evals,
97+
AdditionColumn::B => &self.witness.cols[1].evals,
98+
AdditionColumn::C => &self.witness.cols[2].evals,
99+
}
100+
}
101+
}
102+
83103
/// Simply compute A + B - C
84104
pub fn interpreter_simple_add<
85105
F: PrimeField,
@@ -153,12 +173,6 @@ pub fn heavy_test_simple_add() {
153173

154174
// ---- Defining the folding configuration ----
155175
// FoldingConfig
156-
impl FoldingColumnTrait for AdditionColumn {
157-
fn is_witness(&self) -> bool {
158-
true
159-
}
160-
}
161-
162176
type AppWitnessBuilderEnv = WitnessBuilderEnv<
163177
Fp,
164178
AdditionColumn,
@@ -169,20 +183,6 @@ pub fn heavy_test_simple_add() {
169183
DummyLookupTable,
170184
>;
171185

172-
impl<const N_COL: usize, const N_FSEL: usize> Index<AdditionColumn>
173-
for PlonkishWitness<N_COL, N_FSEL, Fp>
174-
{
175-
type Output = [Fp];
176-
177-
fn index(&self, index: AdditionColumn) -> &Self::Output {
178-
match index {
179-
AdditionColumn::A => &self.witness.cols[0].evals,
180-
AdditionColumn::B => &self.witness.cols[1].evals,
181-
AdditionColumn::C => &self.witness.cols[2].evals,
182-
}
183-
}
184-
}
185-
186186
type Config<
187187
const N_COL_TOTAL: usize,
188188
const N_CHALS: usize,

kimchi-stubs/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ repository = "https://github.com/MinaProtocol/mina"
77
license = "MIT/Apache-2.0"
88
edition = "2021"
99

10+
[lints]
11+
workspace = true
12+
1013
[lib]
1114
name = "kimchi_stubs"
1215
# Important: do not ask to build a dynamic library.
1316
# On MacOS arm64, ocaml-rs.v0.2.2 causes build issues.
1417
# On the Mina side, a fake and empty dllkimchi_stubs.so file is used.
1518
crate-type = ["lib", "staticlib"]
1619

20+
[features]
21+
no-std = []
22+
1723
[dependencies]
1824
libc.workspace = true
1925
num-bigint = { workspace = true, features = ["rand", "serde"] }

kimchi-stubs/src/arkworks/bigint_256.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl From<BigInteger256> for CamlBigInteger256 {
3232
}
3333
}
3434

35-
unsafe impl<'a> ocaml::FromValue<'a> for CamlBigInteger256 {
35+
unsafe impl ocaml::FromValue<'_> for CamlBigInteger256 {
3636
fn from_value(value: ocaml::Value) -> Self {
3737
let x: ocaml::Pointer<Self> = ocaml::FromValue::from_value(value);
3838
*x.as_ref()

kimchi-stubs/src/arkworks/group_projective.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use mina_curves::pasta::curves::{pallas::ProjectivePallas, vesta::ProjectiveVest
66
#[derive(Clone, Copy, ocaml_gen::CustomType)]
77
pub struct CamlGroupProjectivePallas(pub ProjectivePallas);
88

9-
unsafe impl<'a> ocaml::FromValue<'a> for CamlGroupProjectivePallas {
9+
unsafe impl ocaml::FromValue<'_> for CamlGroupProjectivePallas {
1010
fn from_value(value: ocaml::Value) -> Self {
1111
let x: ocaml::Pointer<Self> = ocaml::FromValue::from_value(value);
1212
*x.as_ref()
@@ -111,7 +111,7 @@ impl Neg for &CamlGroupProjectivePallas {
111111
#[derive(Clone, Copy, ocaml_gen::CustomType)]
112112
pub struct CamlGroupProjectiveVesta(pub ProjectiveVesta);
113113

114-
unsafe impl<'a> ocaml::FromValue<'a> for CamlGroupProjectiveVesta {
114+
unsafe impl ocaml::FromValue<'_> for CamlGroupProjectiveVesta {
115115
fn from_value(value: ocaml::Value) -> Self {
116116
let x: ocaml::Pointer<Self> = ocaml::FromValue::from_value(value);
117117
*x.as_ref()

kimchi-stubs/src/arkworks/pasta_fp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rand::rngs::StdRng;
1717
#[derive(Clone, Copy, Debug, ocaml_gen::CustomType)]
1818
pub struct CamlFp(pub Fp);
1919

20-
unsafe impl<'a> ocaml::FromValue<'a> for CamlFp {
20+
unsafe impl ocaml::FromValue<'_> for CamlFp {
2121
fn from_value(value: ocaml::Value) -> Self {
2222
let x: ocaml::Pointer<Self> = ocaml::FromValue::from_value(value);
2323
*x.as_ref()

0 commit comments

Comments
 (0)