Is there a reason why Hash and Eq are not
implemented for function which have a parameter
with a lifetime valid for any lifetime.
E.g. for <'a> fn(&'a u32) or short fn(&u32)
does not implement Hash/Eq …
I have a number of validation function, which are meant to be defined statically (e.g. through a macro, outside of the crate). And I intended to store them in a HashSet, as it is quite likely that the same function
is added multiple times.
EDIT:
a workaround is to use a HashMap<usize, fn(&u32)>
(or whatever your function types is) and to fill it like
map.insert(func as usize, func).