From 5e40560367bb2e591c5275d211d661e1aa1eef03 Mon Sep 17 00:00:00 2001 From: Joris Hartog Date: Sun, 21 Mar 2021 12:02:33 +0100 Subject: [PATCH] Specify type in autoHash error message This commit simply specifies the type which `autoHash` can't hash in the compile error. Closes #7970. --- lib/std/hash/auto_hash.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/hash/auto_hash.zig b/lib/std/hash/auto_hash.zig index 4afc2b425b..e053e87efb 100644 --- a/lib/std/hash/auto_hash.zig +++ b/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.