From 6252861014f9a94a4bcd0204c7b688fc836e44c2 Mon Sep 17 00:00:00 2001 From: Douglas Wilson Date: Fri, 26 Apr 2024 13:20:12 +0100 Subject: [PATCH] fix: disable serialisation tests when miri is active --- hugr/src/hugr/serialize.rs | 3 +-- hugr/src/hugr/validate.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hugr/src/hugr/serialize.rs b/hugr/src/hugr/serialize.rs index ccfa5b6f3c..d10f4e8bbe 100644 --- a/hugr/src/hugr/serialize.rs +++ b/hugr/src/hugr/serialize.rs @@ -260,8 +260,7 @@ impl TryFrom for Hugr { } } -#[cfg(test)] -#[cfg_attr(miri, ignore = "miri does not support 'life before main'")] +#[cfg(all(test, not(miri)))] // Miri doesn't run the extension registration required by `typetag` for // registering `CustomConst`s. https://github.com/rust-lang/miri/issues/450 pub mod test { diff --git a/hugr/src/hugr/validate.rs b/hugr/src/hugr/validate.rs index 2ee170596d..6b19636fbb 100644 --- a/hugr/src/hugr/validate.rs +++ b/hugr/src/hugr/validate.rs @@ -104,8 +104,7 @@ impl<'a, 'b> ValidationContext<'a, 'b> { // TODO: We should also verify that the serialized hugr matches the // in-tree schema. For now, our serialized hugr does not match the // schema. When this is fixed we should pass true below. - #[cfg(test)] - #[cfg_attr(miri, ignore = "miri does not support 'life before main'")] + #[cfg(all(test, not(miri)))] crate::hugr::serialize::test::check_hugr_roundtrip(self.hugr, false); Ok(())