fix cargo doc warnings (#417)

This commit is contained in:
Daniel Gulotta 2025-09-10 10:29:01 -07:00 committed by GitHub
parent c6c78304a9
commit 03db60d94c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 14 additions and 14 deletions

View file

@ -42,7 +42,7 @@ type ECField = QuinticExtension<GoldilocksField>;
/// Computes sqrt in ECField as sqrt(x) = sqrt(x^r)/x^((r-1)/2) with r /// 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 /// = 1 + p + ... + p^4, where the numerator involves a sqrt in
/// GoldilocksField, cf. /// GoldilocksField, cf.
/// https://github.com/pornin/ecgfp5/blob/ce059c6d1e1662db437aecbf3db6bb67fe63c716/rust/src/field.rs#L1041 /// <https://github.com/pornin/ecgfp5/blob/ce059c6d1e1662db437aecbf3db6bb67fe63c716/rust/src/field.rs#L1041>
pub fn ec_field_sqrt(x: &ECField) -> Option<ECField> { pub fn ec_field_sqrt(x: &ECField) -> Option<ECField> {
// Compute x^r. // Compute x^r.
let x_to_the_r = (0..5) let x_to_the_r = (0..5)

View file

@ -41,10 +41,10 @@ use crate::backends::plonky2::{
/// allocation of operations to gates via the `current_slots` field. Once the circuit is fully /// allocation of operations to gates via the `current_slots` field. Once the circuit is fully
/// defined, during the build the circuit the generators /// defined, during the build the circuit the generators
/// associated to unused operations (free slots) are removed: /// associated to unused operations (free slots) are removed:
/// https://github.com/0xPolygonZero/plonky2/blob/82791c4809d6275682c34b926390ecdbdc2a5297/plonky2/src/plonk/circuit_builder.rs#L1210 /// <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 /// 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: /// 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 /// <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 /// 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, /// 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 /// the unused slots still pass the constraints). This is the reason why this gate doesn't add the

View file

@ -1,5 +1,5 @@
//! Module that implements the MerkleTree specified at //! Module that implements the MerkleTree specified at
//! https://0xparc.github.io/pod2/merkletree.html . //! <https://0xparc.github.io/pod2/merkletree.html> .
use std::{collections::HashMap, fmt, iter::IntoIterator}; use std::{collections::HashMap, fmt, iter::IntoIterator};
use itertools::zip_eq; use itertools::zip_eq;
@ -14,7 +14,7 @@ pub mod error;
pub use error::{TreeError, TreeResult}; pub use error::{TreeError, TreeResult};
/// Implements the MerkleTree specified at /// Implements the MerkleTree specified at
/// https://0xparc.github.io/pod2/merkletree.html /// <https://0xparc.github.io/pod2/merkletree.html>
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct MerkleTree { pub struct MerkleTree {
max_depth: usize, max_depth: usize,

View file

@ -1,5 +1,5 @@
//! Proof-based signatures using Plonky2 proofs, following //! Proof-based signatures using Plonky2 proofs, following
//! https://eprint.iacr.org/2024/1553 . //! <https://eprint.iacr.org/2024/1553> .
pub mod circuit; pub mod circuit;
pub use circuit::*; pub use circuit::*;

View file

@ -1,5 +1,5 @@
//! This file implements the types defined at //! This file implements the types defined at
//! https://0xparc.github.io/pod2/values.html#dictionary-array-set . //! <https://0xparc.github.io/pod2/values.html#dictionary-array-set> .
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};

View file

@ -989,6 +989,6 @@ pub trait MainPodProver {
} }
pub trait ToFields { pub trait ToFields {
/// returns Vec<F> representation of the type /// returns `Vec<F>` representation of the type
fn to_fields(&self, params: &Params) -> Vec<F>; fn to_fields(&self, params: &Params) -> Vec<F>;
} }

View file

@ -50,8 +50,8 @@ impl fmt::Display for OperationAux {
impl ToFields for OperationType { impl ToFields for OperationType {
/// Encoding: /// Encoding:
/// - Native(native_op) => [1, [native_op], 0, 0, 0, 0] /// - Native(native_op) => `[1, [native_op], 0, 0, 0, 0]`
/// - Custom(batch, index) => [3, [batch.id], index] /// - Custom(batch, index) => `[3, [batch.id], index]`
fn to_fields(&self, params: &Params) -> Vec<F> { fn to_fields(&self, params: &Params) -> Vec<F> {
let mut fields: Vec<F> = match self { let mut fields: Vec<F> = match self {
Self::Native(p) => iter::once(F::from_canonical_u64(1)) Self::Native(p) => iter::once(F::from_canonical_u64(1))

View file

@ -485,10 +485,10 @@ impl StatementArg {
impl ToFields for StatementArg { impl ToFields for StatementArg {
/// Encoding: /// Encoding:
/// - None => [0, 0, 0, 0, 0, 0, 0, 0] /// - None => `[0, 0, 0, 0, 0, 0, 0, 0]`
/// - Literal(v) => [[v], 0, 0, 0, 0] /// - Literal(v) => `[[v], 0, 0, 0, 0]`
/// - Key(root, key) => [[root], [key]] /// - Key(root, key) => `[[root], [key]]`
/// - WildcardLiteral(v) => [[v], 0, 0, 0, 0] /// - WildcardLiteral(v) => `[[v], 0, 0, 0, 0]`
fn to_fields(&self, params: &Params) -> Vec<F> { fn to_fields(&self, params: &Params) -> Vec<F> {
// NOTE for @ax0: I removed the old comment because may `to_fields` implementations do // NOTE for @ax0: I removed the old comment because may `to_fields` implementations do
// padding and we need fixed output length for the circuits. // padding and we need fixed output length for the circuits.