Add PartialEq to BoundKind and Value

Implement PartialEq for BoundKind to allow for structural equality
checks during optimization. This enables the optimizer to terminate
early when a node no longer changes.

Also, implement PartialEq for Value to facilitate comparisons between
different Value variants.
This commit is contained in:
Michael Schimmel
2026-02-21 20:01:58 +01:00
parent 56b8e8389b
commit f980d9befc
4 changed files with 84 additions and 3 deletions
+3 -1
View File
@@ -24,7 +24,9 @@ impl Optimizer {
let mut current = node;
for _ in 0..self.max_passes {
let next = self.visit_node(current.clone());
// TODO: Structural equality check to stop early
if next == current {
break;
}
current = next;
}
current