There are a lot of variants of Ref(node): Ref<'a, ast::Expr<'a>> scattered around the queries. This makes them hard to read, and annoying to work with.
Make #[moore_derive::query] recognize a #[ptr_eq] attribute (or similar), which wraps the given argument in a Ref-like structure that performs equality/hashing by pointer address. The long-term goal would be to never see Ref<...> again in the code :smiley: .
An alternative would be to require all query arguments to implement a QueryArg trait, which has a corresponding function for deriving lookup keys. This would likely be the most transparent implementation.
There are a lot of variants of
Ref(node): Ref<'a, ast::Expr<'a>>
scattered around the queries. This makes them hard to read, and annoying to work with.Make
#[moore_derive::query]
recognize a#[ptr_eq]
attribute (or similar), which wraps the given argument in aRef
-like structure that performs equality/hashing by pointer address. The long-term goal would be to never seeRef<...>
again in the code :smiley: .An alternative would be to require all query arguments to implement a
QueryArg
trait, which has a corresponding function for deriving lookup keys. This would likely be the most transparent implementation.