diff --git a/lib/std/hash_map.zig b/lib/std/hash_map.zig index 8c4e6b2581..96df243f6e 100644 --- a/lib/std/hash_map.zig +++ b/lib/std/hash_map.zig @@ -370,12 +370,15 @@ pub fn HashMap( comptime Context: type, comptime max_load_percentage: u64, ) type { - comptime verifyContext(Context, K, K, u64, false); return struct { unmanaged: Unmanaged, allocator: Allocator, ctx: Context, + comptime { + verifyContext(Context, K, K, u64, false); + } + /// The type of the unmanaged hash map underlying this wrapper pub const Unmanaged = HashMapUnmanaged(K, V, Context, max_load_percentage); /// An entry, containing pointers to a key and value stored in the map @@ -694,11 +697,13 @@ pub fn HashMapUnmanaged( ) type { if (max_load_percentage <= 0 or max_load_percentage >= 100) @compileError("max_load_percentage must be between 0 and 100."); - comptime verifyContext(Context, K, K, u64, false); - return struct { const Self = @This(); + comptime { + verifyContext(Context, K, K, u64, false); + } + // This is actually a midway pointer to the single buffer containing // a `Header` field, the `Metadata`s and `Entry`s. // At `-@sizeOf(Header)` is the Header field.