authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-11 22:47:24-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-11 22:47:24-07:00
log0f3e8497195f383b9f2eb8cddd84f4966502f521
treefbd7de35abde2487584432a534d828c9ea6bd124
parent491e3ba6b12e79341d8f5f7711678ec597f7b244

std.ArrayList: use variable for local mutable state

stage1 has the wrong semantics here

1 files changed, 2 insertions(+), 1 deletions(-)

lib/std/array_list.zig+2-1
...@@ -1424,7 +1424,8 @@ test "ArrayListAligned/ArrayListAlignedUnmanaged accepts unaligned slices" {...@@ -1424,7 +1424,8 @@ test "ArrayListAligned/ArrayListAlignedUnmanaged accepts unaligned slices" {
14241424
1425test "std.ArrayList(u0)" {1425test "std.ArrayList(u0)" {
1426 // An ArrayList on zero-sized types should not need to allocate1426 // An ArrayList on zero-sized types should not need to allocate
1427 const a = testing.FailingAllocator.init(testing.allocator, 0).allocator();1427 var failing_allocator = testing.FailingAllocator.init(testing.allocator, 0);
1428 const a = failing_allocator.allocator();
14281429
1429 var list = ArrayList(u0).init(a);1430 var list = ArrayList(u0).init(a);
1430 defer list.deinit();1431 defer list.deinit();