Skip to content

Commit

Permalink
and doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-q committed May 15, 2024
1 parent eccbbd4 commit db5514c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion hugr/src/ops/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ pub enum Value {
/// is another `CustomSerialized` we do not attempt to recurse. This behaviour
/// may change in future.
///
/// ```rust
#[cfg_attr(not(miri), doc = "```")] // this doctest depends on typetag, so fails with miri
#[cfg_attr(miri, doc = "```ignore")]
/// use serde::{Serialize,Deserialize};
/// use hugr::{
/// types::Type,ops::constant::{OpaqueValue, ValueName, CustomConst, CustomSerialized},
Expand Down
5 changes: 3 additions & 2 deletions hugr/src/ops/constant/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ use super::ValueName;
/// be serialized with two attributes, `"c"` the tag and `"v"` the
/// `CustomConst`:
///
/// ```rust
#[cfg_attr(not(miri), doc = "```")] // this doctest depends on typetag, so fails with miri
#[cfg_attr(miri, doc = "```ignore")]
/// use serde::{Serialize,Deserialize};
/// use hugr::{
/// types::Type,ops::constant::{OpaqueValue, ValueName, CustomConst},
Expand All @@ -51,7 +52,7 @@ use super::ValueName;
/// "c": "CC",
/// "v": 2
/// }));
/// ````
/// ```
#[typetag::serde(tag = "c", content = "v")]
pub trait CustomConst:
Send + Sync + std::fmt::Debug + CustomConstBoxClone + Any + Downcast
Expand Down

0 comments on commit db5514c

Please sign in to comment.