From 4f527e5d36f66a83ff6a263a03f16e2c4d049f1e Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 20 Apr 2022 17:16:32 -0700 Subject: std: fix missing hash map safety There was a missing compile error for calling ensureUnusedCapacity without a Context in the case that the Context is non-void. --- lib/std/array_hash_map.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/array_hash_map.zig') diff --git a/lib/std/array_hash_map.zig b/lib/std/array_hash_map.zig index 31860963af..304c98a2a9 100644 --- a/lib/std/array_hash_map.zig +++ b/lib/std/array_hash_map.zig @@ -798,7 +798,7 @@ pub fn ArrayHashMapUnmanaged( allocator: Allocator, additional_capacity: usize, ) !void { - if (@sizeOf(ByIndexContext) != 0) + if (@sizeOf(Context) != 0) @compileError("Cannot infer context " ++ @typeName(Context) ++ ", call ensureTotalCapacityContext instead."); return self.ensureUnusedCapacityContext(allocator, additional_capacity, undefined); } -- cgit v1.2.3