Skip to content

Commit

Permalink
Fix doc tests imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ed255 committed Jan 29, 2024
1 parent 4c155be commit fe2e28e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 18 deletions.
5 changes: 3 additions & 2 deletions common/src/circuit/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<V> Value<V> {
/// # Examples
///
/// ```
/// use halo2_proofs::circuit::Value;
/// use halo2_common::circuit::Value;
///
/// let v = Value::known(37);
/// ```
Expand Down Expand Up @@ -646,7 +646,8 @@ impl<V> Value<V> {
/// If you have a `Value<F: Field>`, convert it to `Value<Assigned<F>>` first:
/// ```
/// # use halo2curves::pasta::pallas::Base as F;
/// use halo2_proofs::{circuit::Value, plonk::Assigned};
/// use halo2_common::circuit::Value;
/// use halo2_middleware::plonk::Assigned;
///
/// let v = Value::known(F::from(2));
/// let v: Value<Assigned<F>> = v.into();
Expand Down
19 changes: 10 additions & 9 deletions common/src/plonk/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ impl SealedPhase for super::ThirdPhase {
///
/// Selectors can be used to conditionally enable (portions of) gates:
/// ```
/// use halo2_proofs::poly::Rotation;
/// use halo2_middleware::poly::Rotation;
/// # use halo2curves::pasta::Fp;
/// # use halo2_proofs::plonk::ConstraintSystem;
/// # use halo2_common::plonk::ConstraintSystem;
///
/// # let mut meta = ConstraintSystem::<Fp>::default();
/// let a = meta.advice_column();
Expand All @@ -290,12 +290,12 @@ impl SealedPhase for super::ThirdPhase {
/// Selectors are disabled on all rows by default, and must be explicitly enabled on each
/// row when required:
/// ```
/// use halo2_proofs::{
/// circuit::{Chip, Layouter, Value},
/// plonk::{Advice, Column, Error, Selector},
/// };
/// use halo2_middleware::circuit::Advice;
/// use halo2_common::circuit::{Chip, Layouter, Value};
/// use halo2_common::plonk::circuit::{Column, Selector};
/// use halo2_common::plonk::Error;
/// use halo2_middleware::ff::Field;
/// # use halo2_proofs::plonk::Fixed;
/// # use halo2_middleware::circuit::Fixed;
///
/// struct Config {
/// a: Column<Advice>,
Expand Down Expand Up @@ -1356,9 +1356,10 @@ impl<F: Field> From<Expression<F>> for Vec<Constraint<F>> {
/// A set of polynomial constraints with a common selector.
///
/// ```
/// use halo2_proofs::{plonk::{Constraints, Expression}, poly::Rotation};
/// use halo2_common::{plonk::{Constraints, Expression}};
/// use halo2_middleware::poly::Rotation;
/// use halo2curves::pasta::Fp;
/// # use halo2_proofs::plonk::ConstraintSystem;
/// # use halo2_common::plonk::ConstraintSystem;
///
/// # let mut meta = ConstraintSystem::<Fp>::default();
/// let a = meta.advice_column();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::collections::HashMap;
use std::fmt::Debug;
use std::ops::RangeTo;

mod floor_planner;
pub mod floor_planner;
mod table_layouter;

// Re-exports from common
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,15 @@ impl<F: Field> Mul<F> for Value<F> {
/// # Examples
///
/// ```
/// use halo2_proofs::{
/// use halo2_frontend::{
/// circuit::{Layouter, SimpleFloorPlanner, Value},
/// dev::{FailureLocation, MockProver, VerifyFailure},
/// plonk::{Advice, Any, Circuit, Column, ConstraintSystem, Error, Selector},
/// poly::Rotation,
/// };
/// use halo2_common::{
/// plonk::{circuit::Column, Circuit, ConstraintSystem, Error, Selector},
/// };
/// use halo2_middleware::circuit::{Advice, Any};
/// use halo2_middleware::poly::Rotation;
/// use halo2_middleware::ff::PrimeField;
/// use halo2curves::pasta::Fp;
/// const K: u32 = 5;
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/dev/gates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ struct Gate {
///
/// ```
/// use halo2_middleware::ff::Field;
/// use halo2_proofs::{
/// use halo2_middleware::poly::Rotation;
/// use halo2_frontend::{
/// circuit::{Layouter, SimpleFloorPlanner},
/// dev::CircuitGates,
/// };
/// use halo2_common::{
/// plonk::{Circuit, ConstraintSystem, Error},
/// poly::Rotation,
/// };
/// use halo2curves::pasta::pallas;
///
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/dev/tfp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ use halo2_middleware::plonk::Assigned;
///
/// ```
/// use halo2_middleware::ff::Field;
/// use halo2_proofs::{
/// use halo2_frontend::{
/// circuit::{floor_planner, Layouter, Value},
/// dev::TracingFloorPlanner,
/// };
/// use halo2_common::{
/// plonk::{Circuit, ConstraintSystem, Error},
/// };
///
Expand Down

0 comments on commit fe2e28e

Please sign in to comment.