zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 5e40560367bb2e591c5275d211d661e1aa1eef03 (tree)
parent 0d96a284e80fc3d79af9d56bacb05456b9ed3da4
Author: Joris Hartog <joris.hartog@cyso.nl>
Date:   Sun, 21 Mar 2021 12:02:33 +0100

Specify type in autoHash error message

This commit simply specifies the type which `autoHash` can't hash in the
compile error.

Closes #7970.

Diffstat:
Mlib/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 @@ -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.