Add query derive attribute for equality-by-pointer #214
Labels
C-enhancement
Category: Adding or improving on features.
L-vlog
Language: Verilog and SystemVerilog.
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 😃 .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.The text was updated successfully, but these errors were encountered: