From 03db60d94c8356e8aa60c0d66078a2a7741ec07c Mon Sep 17 00:00:00 2001 From: Daniel Gulotta Date: Wed, 10 Sep 2025 10:29:01 -0700 Subject: [PATCH] fix cargo doc warnings (#417) --- src/backends/plonky2/primitives/ec/curve.rs | 2 +- src/backends/plonky2/primitives/ec/gates/curve.rs | 4 ++-- src/backends/plonky2/primitives/merkletree/mod.rs | 4 ++-- src/backends/plonky2/primitives/signature/mod.rs | 2 +- src/middleware/containers.rs | 2 +- src/middleware/mod.rs | 2 +- src/middleware/operation.rs | 4 ++-- src/middleware/statement.rs | 8 ++++---- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/backends/plonky2/primitives/ec/curve.rs b/src/backends/plonky2/primitives/ec/curve.rs index 474120b..22911b2 100644 --- a/src/backends/plonky2/primitives/ec/curve.rs +++ b/src/backends/plonky2/primitives/ec/curve.rs @@ -42,7 +42,7 @@ type ECField = QuinticExtension; /// Computes sqrt in ECField as sqrt(x) = sqrt(x^r)/x^((r-1)/2) with r /// = 1 + p + ... + p^4, where the numerator involves a sqrt in /// GoldilocksField, cf. -/// https://github.com/pornin/ecgfp5/blob/ce059c6d1e1662db437aecbf3db6bb67fe63c716/rust/src/field.rs#L1041 +/// pub fn ec_field_sqrt(x: &ECField) -> Option { // Compute x^r. let x_to_the_r = (0..5) diff --git a/src/backends/plonky2/primitives/ec/gates/curve.rs b/src/backends/plonky2/primitives/ec/gates/curve.rs index 990390b..289fe53 100644 --- a/src/backends/plonky2/primitives/ec/gates/curve.rs +++ b/src/backends/plonky2/primitives/ec/gates/curve.rs @@ -41,10 +41,10 @@ use crate::backends::plonky2::{ /// allocation of operations to gates via the `current_slots` field. Once the circuit is fully /// defined, during the build the circuit the generators /// associated to unused operations (free slots) are removed: -/// https://github.com/0xPolygonZero/plonky2/blob/82791c4809d6275682c34b926390ecdbdc2a5297/plonky2/src/plonk/circuit_builder.rs#L1210 +/// /// Since the generator for the unused operations are removed, no witness value will be calculated /// for them, and the free slots gate witness wires will be filled with the default value which is zero: -/// https://github.com/0xPolygonZero/plonky2/blob/82791c4809d6275682c34b926390ecdbdc2a5297/plonky2/src/iop/witness.rs#L377 +/// /// This means that a gate with multiple operations need to pass the constraints for a single /// operation when all its witness wire values are zero (so that when the gate is partially used, /// the unused slots still pass the constraints). This is the reason why this gate doesn't add the diff --git a/src/backends/plonky2/primitives/merkletree/mod.rs b/src/backends/plonky2/primitives/merkletree/mod.rs index 3c7d372..e0dff04 100644 --- a/src/backends/plonky2/primitives/merkletree/mod.rs +++ b/src/backends/plonky2/primitives/merkletree/mod.rs @@ -1,5 +1,5 @@ //! Module that implements the MerkleTree specified at -//! https://0xparc.github.io/pod2/merkletree.html . +//! . use std::{collections::HashMap, fmt, iter::IntoIterator}; use itertools::zip_eq; @@ -14,7 +14,7 @@ pub mod error; pub use error::{TreeError, TreeResult}; /// Implements the MerkleTree specified at -/// https://0xparc.github.io/pod2/merkletree.html +/// #[derive(Clone, Debug)] pub struct MerkleTree { max_depth: usize, diff --git a/src/backends/plonky2/primitives/signature/mod.rs b/src/backends/plonky2/primitives/signature/mod.rs index 2f57e01..d37519f 100644 --- a/src/backends/plonky2/primitives/signature/mod.rs +++ b/src/backends/plonky2/primitives/signature/mod.rs @@ -1,5 +1,5 @@ //! Proof-based signatures using Plonky2 proofs, following -//! https://eprint.iacr.org/2024/1553 . +//! . pub mod circuit; pub use circuit::*; diff --git a/src/middleware/containers.rs b/src/middleware/containers.rs index 7fb3e96..8a7f1cc 100644 --- a/src/middleware/containers.rs +++ b/src/middleware/containers.rs @@ -1,5 +1,5 @@ //! This file implements the types defined at -//! https://0xparc.github.io/pod2/values.html#dictionary-array-set . +//! . use std::collections::{HashMap, HashSet}; diff --git a/src/middleware/mod.rs b/src/middleware/mod.rs index 92a85fb..8ae3760 100644 --- a/src/middleware/mod.rs +++ b/src/middleware/mod.rs @@ -989,6 +989,6 @@ pub trait MainPodProver { } pub trait ToFields { - /// returns Vec representation of the type + /// returns `Vec` representation of the type fn to_fields(&self, params: &Params) -> Vec; } diff --git a/src/middleware/operation.rs b/src/middleware/operation.rs index e85d1d5..d8b7f5a 100644 --- a/src/middleware/operation.rs +++ b/src/middleware/operation.rs @@ -50,8 +50,8 @@ impl fmt::Display for OperationAux { impl ToFields for OperationType { /// Encoding: - /// - Native(native_op) => [1, [native_op], 0, 0, 0, 0] - /// - Custom(batch, index) => [3, [batch.id], index] + /// - Native(native_op) => `[1, [native_op], 0, 0, 0, 0]` + /// - Custom(batch, index) => `[3, [batch.id], index]` fn to_fields(&self, params: &Params) -> Vec { let mut fields: Vec = match self { Self::Native(p) => iter::once(F::from_canonical_u64(1)) diff --git a/src/middleware/statement.rs b/src/middleware/statement.rs index 2ae0e0e..6989081 100644 --- a/src/middleware/statement.rs +++ b/src/middleware/statement.rs @@ -485,10 +485,10 @@ impl StatementArg { impl ToFields for StatementArg { /// Encoding: - /// - None => [0, 0, 0, 0, 0, 0, 0, 0] - /// - Literal(v) => [[v], 0, 0, 0, 0] - /// - Key(root, key) => [[root], [key]] - /// - WildcardLiteral(v) => [[v], 0, 0, 0, 0] + /// - None => `[0, 0, 0, 0, 0, 0, 0, 0]` + /// - Literal(v) => `[[v], 0, 0, 0, 0]` + /// - Key(root, key) => `[[root], [key]]` + /// - WildcardLiteral(v) => `[[v], 0, 0, 0, 0]` fn to_fields(&self, params: &Params) -> Vec { // NOTE for @ax0: I removed the old comment because may `to_fields` implementations do // padding and we need fixed output length for the circuits.