diff --git a/hugr-core/src/hugr/hugrmut.rs b/hugr-core/src/hugr/hugrmut.rs index 409661e7d..3d9edc050 100644 --- a/hugr-core/src/hugr/hugrmut.rs +++ b/hugr-core/src/hugr/hugrmut.rs @@ -124,10 +124,10 @@ pub trait HugrMut: HugrMutInternals { /// /// # Panics /// - /// If the node is not in the graph. + /// If the node is not in the graph, or if the node is the root node. #[inline] fn remove_node(&mut self, node: Node) -> OpType { - panic_invalid_node(self, node); + panic_invalid_non_root(self, node); self.hugr_mut().remove_node(node) }