| author | |
| committer | |
| log | 4f527e5d36f66a83ff6a263a03f16e2c4d049f1e |
| tree | 7ea75f706f934a32f0c7dd9b3ec4ca392855fe1d |
| parent | 99112b63bdeec512e164f289556b24fa1554a775 |
There was a missing compile error for calling ensureUnusedCapacity
without a Context in the case that the Context is non-void.2 files changed, 3 insertions(+), 1 deletions(-)
lib/std/array_hash_map.zig+1-1| ... | ... | @@ -798,7 +798,7 @@ pub fn ArrayHashMapUnmanaged( |
| 798 | 798 | allocator: Allocator, |
| 799 | 799 | additional_capacity: usize, |
| 800 | 800 | ) !void { |
| 801 | if (@sizeOf(ByIndexContext) != 0) | |
| 801 | if (@sizeOf(Context) != 0) | |
| 802 | 802 | @compileError("Cannot infer context " ++ @typeName(Context) ++ ", call ensureTotalCapacityContext instead."); |
| 803 | 803 | return self.ensureUnusedCapacityContext(allocator, additional_capacity, undefined); |
| 804 | 804 | } |
lib/std/hash_map.zig+2| ... | ... | @@ -913,6 +913,8 @@ pub fn HashMapUnmanaged( |
| 913 | 913 | } |
| 914 | 914 | |
| 915 | 915 | pub fn ensureUnusedCapacity(self: *Self, allocator: Allocator, additional_size: Size) Allocator.Error!void { |
| 916 | if (@sizeOf(Context) != 0) | |
| 917 | @compileError("Cannot infer context " ++ @typeName(Context) ++ ", call ensureUnusedCapacityContext instead."); | |
| 916 | 918 | return ensureUnusedCapacityContext(self, allocator, additional_size, undefined); |
| 917 | 919 | } |
| 918 | 920 | pub fn ensureUnusedCapacityContext(self: *Self, allocator: Allocator, additional_size: Size, ctx: Context) Allocator.Error!void { |