Implement std::hash::Hash for ApInt.
Since ApInt is similar to a Vec<u64 we can employ a similar strategy to actually implement Hash.
Vec did it by deref into a slice over its elements and then simply uses the Hash implementation of the fundamental slice type as can be seen here.
While doing this it might be useful to also implement Hash for other types in the public interface.
Implement
std::hash::Hash
forApInt
. SinceApInt
is similar to aVec<u64
we can employ a similar strategy to actually implementHash
.Vec
did it by deref into aslice
over its elements and then simply uses theHash
implementation of the fundamentalslice
type as can be seen here.While doing this it might be useful to also implement
Hash
for other types in the public interface.Implement
std::hash::Hash
for ...ApInt
Bit
BitWidth
BitPos
Digit
Error
ErrorKind
PrimitiveTy
Radix
ShiftAmount