Skip to content

Commit b209709

Browse files
authored
feat!: Hugrmut on generic nodes (#2111)
- Allows `HugrMut` to be implemented for `HugrView`s with arbitrary node types - Removes `HugrMutInternals::hugr_mut(&mut self) -> &mut Hugr`, it can be implemented for more complex types. This is required for #1926, but I haven't touched the read-only side yet. - Added a `Node` associated type to `Rewrite`. All existing rewrites only implement `Rewrite<Node = Node>` for now, expanding their type is left for a separate PR. drive-by: Fix a couple bugs in rewrite implementations that assumed that `SiblingMut` contained transitive children. BREAKING CHANGE: `HugrMut` is now implemented generically for any `HugrView::Node` type. BREAKING CHANGE: `SiblingMut` has a new type parameter for the wrapped hugr type.
1 parent d8a5d67 commit b209709

30 files changed

+676
-575
lines changed

hugr-core/src/builder/build_traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pub trait Container {
153153
where
154154
ExtensionRegistry: Extend<Reg>,
155155
{
156-
self.hugr_mut().extensions_mut().extend(registry);
156+
self.hugr_mut().use_extensions(registry);
157157
}
158158
}
159159

0 commit comments

Comments
 (0)