Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hugr-core/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ pub static EMPTY_REG: ExtensionRegistry = ExtensionRegistry {
/// TODO: decide on failure modes
#[derive(Debug, Clone, Error, PartialEq, Eq)]
#[allow(missing_docs)]
#[non_exhaustive]
pub enum SignatureError {
/// Name mismatch
#[error("Definition name ({0}) and instantiation name ({1}) do not match.")]
Expand Down
1 change: 1 addition & 0 deletions hugr-core/src/hugr/serialize/upgrade.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use thiserror::Error;

#[derive(Debug, Error)]
#[non_exhaustive]
pub enum UpgradeError {
#[error(transparent)]
Deserialize(#[from] serde_json::Error),
Expand Down
2 changes: 2 additions & 0 deletions hugr-core/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use thiserror::Error;

/// Error during import.
#[derive(Debug, Clone, Error)]
#[non_exhaustive]
pub enum ImportError {
/// The model contains a feature that is not supported by the importer yet.
/// Errors of this kind are expected to be removed as the model format and
Expand Down Expand Up @@ -75,6 +76,7 @@ pub enum ImportError {

/// Import error caused by incorrect order hints.
#[derive(Debug, Clone, Error)]
#[non_exhaustive]
pub enum OrderHintError {
/// Duplicate order hint key in the same region.
#[error("duplicate order hint key {0}")]
Expand Down
1 change: 1 addition & 0 deletions hugr-model/src/v0/ast/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ impl<'a> Context<'a> {

/// Error that may occur in [`Module::resolve`].
#[derive(Debug, Clone, Error)]
#[non_exhaustive]
pub enum ResolveError {
/// Unknown variable.
#[error("unknown var: {0}")]
Expand Down
1 change: 1 addition & 0 deletions hugr-model/src/v0/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ pub struct VarId(pub NodeId, pub VarIndex);

/// Errors that can occur when traversing and interpreting the model.
#[derive(Debug, Clone, Error)]
#[non_exhaustive]
pub enum ModelError {
/// There is a reference to a node that does not exist.
#[error("node not found: {0}")]
Expand Down
1 change: 1 addition & 0 deletions hugr-passes/src/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub fn replace_many_ops<S: Into<OpType>>(
/// Errors produced by the [`lower_ops`] function.
#[derive(Debug, Error)]
#[error(transparent)]
#[non_exhaustive]
pub enum LowerError {
/// Invalid subgraph.
#[error("Subgraph formed by node is invalid: {0}")]
Expand Down
1 change: 1 addition & 0 deletions hugr-passes/src/non_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub fn nonlocal_edges<H: HugrView>(hugr: &H) -> impl Iterator<Item = (H::Node, I
}

#[derive(Error, Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum NonLocalEdgesError<N> {
#[error("Found {} nonlocal edges", .0.len())]
Edges(Vec<(N, IncomingPort)>),
Expand Down
1 change: 1 addition & 0 deletions hugr-passes/src/replace_types/linearize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ pub struct CallbackHandler<'a>(#[allow(dead_code)] &'a DelegatingLinearizer);

#[derive(Clone, Debug, thiserror::Error, PartialEq, Eq)]
#[allow(missing_docs)]
#[non_exhaustive]
pub enum LinearizeError {
#[error("Need copy/discard op for {_0}")]
NeedCopyDiscard(Type),
Expand Down
1 change: 1 addition & 0 deletions hugr-passes/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub enum ValidationLevel {

#[derive(Error, Debug, PartialEq)]
#[allow(missing_docs)]
#[non_exhaustive]
pub enum ValidatePassError {
#[error("Failed to validate input HUGR: {err}\n{pretty_hugr}")]
InputError {
Expand Down
Loading