aboutsummaryrefslogtreecommitdiff
path: root/lib/std/hash/verify.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-08-28 02:35:53 +0100
committermlugg <mlugg@mlugg.co.uk>2024-08-28 08:39:59 +0100
commit0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9 (patch)
tree2c07fddf2b6230360fe618c4de192bc2d24eeaf7 /lib/std/hash/verify.zig
parent1a178d499537b922ff05c5d0186ed5a00dbb1a9b (diff)
downloadzig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.tar.gz
zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.zip
std: update `std.builtin.Type` fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
Diffstat (limited to 'lib/std/hash/verify.zig')
-rw-r--r--lib/std/hash/verify.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/hash/verify.zig b/lib/std/hash/verify.zig
index 485a1fd976..61f501a881 100644
--- a/lib/std/hash/verify.zig
+++ b/lib/std/hash/verify.zig
@@ -1,9 +1,9 @@
const std = @import("std");
-fn hashMaybeSeed(comptime hash_fn: anytype, seed: anytype, buf: []const u8) @typeInfo(@TypeOf(hash_fn)).Fn.return_type.? {
- const HashFn = @typeInfo(@TypeOf(hash_fn)).Fn;
+fn hashMaybeSeed(comptime hash_fn: anytype, seed: anytype, buf: []const u8) @typeInfo(@TypeOf(hash_fn)).@"fn".return_type.? {
+ const HashFn = @typeInfo(@TypeOf(hash_fn)).@"fn";
if (HashFn.params.len > 1) {
- if (@typeInfo(HashFn.params[0].type.?) == .Int) {
+ if (@typeInfo(HashFn.params[0].type.?) == .int) {
return hash_fn(@intCast(seed), buf);
} else {
return hash_fn(buf, @intCast(seed));
@@ -14,7 +14,7 @@ fn hashMaybeSeed(comptime hash_fn: anytype, seed: anytype, buf: []const u8) @typ
}
fn initMaybeSeed(comptime Hash: anytype, seed: anytype) Hash {
- const HashFn = @typeInfo(@TypeOf(Hash.init)).Fn;
+ const HashFn = @typeInfo(@TypeOf(Hash.init)).@"fn";
if (HashFn.params.len == 1) {
return Hash.init(@intCast(seed));
} else {
@@ -27,7 +27,7 @@ fn initMaybeSeed(comptime Hash: anytype, seed: anytype) Hash {
// Hash keys of the form {0}, {0,1}, {0,1,2}... up to N=255, using 256-N as seed.
// First four-bytes of the hash, interpreted as little-endian is the verification code.
pub fn smhasher(comptime hash_fn: anytype) u32 {
- const HashFnTy = @typeInfo(@TypeOf(hash_fn)).Fn;
+ const HashFnTy = @typeInfo(@TypeOf(hash_fn)).@"fn";
const HashResult = HashFnTy.return_type.?;
const hash_size = @sizeOf(HashResult);