Commit 5e40560367

Joris Hartog <joris.hartog@cyso.nl>
2021-03-21 12:02:33
Specify type in autoHash error message
This commit simply specifies the type which `autoHash` can't hash in the compile error. Closes #7970.
1 parent 0d96a28
Changed files (1)
lib
std
lib/std/hash/auto_hash.zig
@@ -95,7 +95,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
         .EnumLiteral,
         .Frame,
         .Float,
-        => @compileError("cannot hash this type"),
+        => @compileError("unable to hash type " ++ @typeName(Key)),
 
         // Help the optimizer see that hashing an int is easy by inlining!
         // TODO Check if the situation is better after #561 is resolved.