hashes for refs should be an opt-in feature (#18098)

This commit is contained in:
Miran 2021-05-30 23:55:51 +02:00 • committed by GitHub
commit 50e98e6efa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 5 deletions

View file

@ -236,7 +236,7 @@ proc hash*[T](x: ptr[T]): Hash {.inline.} =
assert cast[pointer](a[0].addr).hash == a[0].addr.hash
hash(cast[pointer](x))
when not defined(nimLegacyNoHashRef):
when defined(nimEnableHashRef):
proc hash*[T](x: ref[T]): Hash {.inline.} =
## Efficient `hash` overload.
runnableExamples: