From 3847871b286407e600a6ddc16660a1e9b6d6ec4b Mon Sep 17 00:00:00 2001 From: oflatt Date: Tue, 6 Aug 2024 11:56:22 -0600 Subject: [PATCH] fix determinism bug using indexmap --- src/ast/mod.rs | 2 +- src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ast/mod.rs b/src/ast/mod.rs index 8175223c..4303e1ea 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -48,7 +48,7 @@ impl Display for Id { #[derive(Clone, Debug)] /// The egglog internal representation of already compiled rules pub(crate) enum Ruleset { - Rules(Symbol, HashMap), + Rules(Symbol, IndexMap), Combined(Symbol, Vec), } diff --git a/src/lib.rs b/src/lib.rs index 6b0de2dc..ac74cf6f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1100,8 +1100,8 @@ impl EGraph { match rules { Ruleset::Rules(_, rules) => { match rules.entry(name) { - Entry::Occupied(_) => panic!("Rule '{name}' was already present"), - Entry::Vacant(e) => e.insert(compiled_rule), + indexmap::map::Entry::Occupied(_) => panic!("Rule '{name}' was already present"), + indexmap::map::Entry::Vacant(e) => e.insert(compiled_rule), }; Ok(name) }