diff --git a/src/builder/cfg.rs b/src/builder/cfg.rs index 2bfebdd7b..5279b5a3a 100644 --- a/src/builder/cfg.rs +++ b/src/builder/cfg.rs @@ -16,6 +16,7 @@ use crate::{hugr::HugrMut, types::TypeRow, Hugr}; /// Builder for a [`crate::ops::CFG`] child control /// flow graph +#[derive(Debug, PartialEq)] pub struct CFGBuilder { pub(super) base: T, pub(super) cfg_node: Node, diff --git a/src/builder/circuit_builder.rs b/src/builder/circuit_builder.rs index cbf3f84d9..ab55d6111 100644 --- a/src/builder/circuit_builder.rs +++ b/src/builder/circuit_builder.rs @@ -10,6 +10,7 @@ use crate::Wire; /// Builder to build regions of dataflow graphs that look like Circuits, /// where some inputs of operations directly correspond to some outputs. /// Allows appending operations by indexing a vector of input wires. +#[derive(Debug, PartialEq)] pub struct CircuitBuilder<'a, T: ?Sized> { wires: Vec, builder: &'a mut T, @@ -17,6 +18,7 @@ pub struct CircuitBuilder<'a, T: ?Sized> { /// Enum for specifying a [`CircuitBuilder`] input wire using either an index to /// the builder vector of wires, or an arbitrary other wire. +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AppendWire { /// Arbitrary input wire. W(Wire), diff --git a/src/builder/conditional.rs b/src/builder/conditional.rs index c669aa8de..38c7d7b16 100644 --- a/src/builder/conditional.rs +++ b/src/builder/conditional.rs @@ -40,6 +40,7 @@ pub enum ConditionalBuildError { } /// Builder for a [`ops::Conditional`] node's children. +#[derive(Debug, Clone, PartialEq)] pub struct ConditionalBuilder { pub(super) base: T, pub(super) conditional_node: Node, diff --git a/src/builder/dataflow.rs b/src/builder/dataflow.rs index 0804bad48..f9e16990e 100644 --- a/src/builder/dataflow.rs +++ b/src/builder/dataflow.rs @@ -13,6 +13,7 @@ use crate::Node; use crate::{hugr::HugrMut, Hugr}; /// Builder for a [`ops::DFG`] node. +#[derive(Debug, Clone, PartialEq)] pub struct DFGBuilder { pub(crate) base: T, pub(crate) dfg_node: Node, @@ -115,6 +116,7 @@ impl + AsRef> Dataflow for DFGBuilder { /// Wrapper around [`DFGBuilder`] used to build other dataflow regions. // Stores option of DFGBuilder so it can be taken out without moving. +#[derive(Debug, Clone, PartialEq)] pub struct DFGWrapper(DFGBuilder, PhantomData); impl DFGWrapper { diff --git a/src/builder/module_builder.rs b/src/builder/module_builder.rs index 49d809441..2c5098d5f 100644 --- a/src/builder/module_builder.rs +++ b/src/builder/module_builder.rs @@ -21,6 +21,7 @@ use smol_str::SmolStr; use crate::{hugr::HugrMut, Hugr}; /// Builder for a HUGR module. +#[derive(Debug, Clone, PartialEq)] pub struct ModuleBuilder(pub(super) T); impl + AsRef> Container for ModuleBuilder {