zig

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

commit 0f3e8497195f383b9f2eb8cddd84f4966502f521 (tree)
parent 491e3ba6b12e79341d8f5f7711678ec597f7b244
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Fri, 11 Mar 2022 22:47:24 -0700

std.ArrayList: use variable for local mutable state

stage1 has the wrong semantics here

Diffstat:
Mlib/std/array_list.zig | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/std/array_list.zig b/lib/std/array_list.zig @@ -1424,7 +1424,8 @@ test "ArrayListAligned/ArrayListAlignedUnmanaged accepts unaligned slices" { test "std.ArrayList(u0)" { // An ArrayList on zero-sized types should not need to allocate - const a = testing.FailingAllocator.init(testing.allocator, 0).allocator(); + var failing_allocator = testing.FailingAllocator.init(testing.allocator, 0); + const a = failing_allocator.allocator(); var list = ArrayList(u0).init(a); defer list.deinit();