diff --git a/src/hugr/validate.rs b/src/hugr/validate.rs index cea7425bd..5d55022d0 100644 --- a/src/hugr/validate.rs +++ b/src/hugr/validate.rs @@ -997,8 +997,9 @@ mod test { .map_into() .collect_tuple() .unwrap(); - let mut closure = b.infer_extensions().unwrap(); - assert!(closure.remove(©).is_some()); + let closure = b.infer_extensions().unwrap(); + b.instantiate_extensions(closure); + b.validate(&EMPTY_REG).unwrap(); b.replace_op( copy, NodeType::pure(ops::CFG { @@ -1010,7 +1011,7 @@ mod test { // (i.e. update_and_validate) on such a malformed Hugr, and pure `validate(&EMPTY_REG)` // fails because of missing extension annotations (contained in the closure) assert_matches!( - b.validate_with_extension_closure(closure, &EMPTY_REG), + b.validate(&EMPTY_REG), Err(ValidationError::ContainerWithoutChildren { .. }) ); let cfg = copy;