Skip to content

Commit

Permalink
feat: Add an OpLoadError variant of BuildError. (#1537)
Browse files Browse the repository at this point in the history
closes #1536
  • Loading branch information
doug-q authored Oct 1, 2024
1 parent 92f18e7 commit e45ab5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions hugr-core/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
//! ```
use thiserror::Error;

use crate::extension::simple_op::OpLoadError;
use crate::extension::{SignatureError, TO_BE_INFERRED};
use crate::hugr::ValidationError;
use crate::ops::handle::{BasicBlockID, CfgID, ConditionalID, DfgID, FuncID, TailLoopID};
Expand Down Expand Up @@ -194,6 +195,10 @@ pub enum BuildError {
#[source]
error: BuilderWiringError,
},

#[error("Failed to load an extension op: {0}")]
#[allow(missing_docs)]
ExtensionOp(#[from] OpLoadError),
}

#[derive(Debug, Clone, PartialEq, Error)]
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/extension/simple_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use delegate::delegate;
use thiserror::Error;

/// Error loading operation.
#[derive(Debug, Error, PartialEq)]
#[derive(Debug, Error, PartialEq, Clone)]
#[error("{0}")]
#[allow(missing_docs)]
#[non_exhaustive]
Expand Down

0 comments on commit e45ab5d

Please sign in to comment.