From f848fe07db474b625404ffc208ea21aa984b52a5 Mon Sep 17 00:00:00 2001 From: Joe Hellerstein Date: Fri, 11 Oct 2024 10:02:48 -0700 Subject: [PATCH] compiles! don't use Merge trait in ColtNode --- lattices/src/ght_lazy.rs | 23 +++++++++++++---------- lattices/src/ght_test.rs | 2 ++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lattices/src/ght_lazy.rs b/lattices/src/ght_lazy.rs index 108a4404c4b..3c6ef02767e 100644 --- a/lattices/src/ght_lazy.rs +++ b/lattices/src/ght_lazy.rs @@ -350,7 +350,7 @@ where as ColumnLazyTrieNode>::Force, // Schema = Schema, // SuffixSchema = SuffixSchema, - // Storage = Storage, + Storage = Storage, >, ::SuffixSchema: 'a, GhtLeaf: ColumnLazyTrieNode, @@ -507,7 +507,7 @@ where } #[sealed] -impl<'a, Head, Node> ColtNode for var_type!(&'a mut GhtInner) +impl<'a, Head, Node> ColtNode for (&'a mut GhtInner, ()) where GhtInner: GeneralizedHashTrieNode, Head: Clone + Eq + Hash, @@ -527,19 +527,22 @@ where #[sealed] impl<'a, Head, Schema, ValType, Storage> ColtNodeTail>> - for var_type!(&'a mut GhtInner>) + for (&'a mut GhtInner>, ()) where - GhtInner>: GeneralizedHashTrieNode - + GhtGet - + crate::Merge>> - + GhtGet, + Self: ColtNode, + // GhtInner>: GeneralizedHashTrieNode + // + GhtGet + // + crate::Merge>> // <---- this type bound made it only work for sets + // + GhtGet, GhtLeaf: GeneralizedHashTrieNode, - Head: Clone + Eq + Hash, - Schema: Clone + Eq + Hash + VariadicExt, + Head: Clone, // + Eq + Hash, + Schema: Eq + Hash, // + Clone + Eq + Hash + VariadicExt, Storage: VariadicCollection, { fn merge(&mut self, inner_to_merge: GhtInner>) { - crate::Merge::merge(self.0, inner_to_merge); + // // we shouldn't use merge - that only works for sets + // crate::Merge::merge(self.0, inner_to_merge); + todo!() } } diff --git a/lattices/src/ght_test.rs b/lattices/src/ght_test.rs index c151b2025d6..f3c01a6cacc 100644 --- a/lattices/src/ght_test.rs +++ b/lattices/src/ght_test.rs @@ -999,6 +999,8 @@ mod test { // 348 | | // SuffixSchema = SuffixSchema, // 349 | | >, // | |_____^ unsatisfied trait bound introduced here + fn guard(_: impl ColtNodeTail) {} + // guard(forest.as_mut_var()); let result = ColtNode::get(forest.as_mut_var(), &3); // println!("forest after get: {:?}", forest); // println!("result.len() = {}", result.len());