Zig Version
0.16.0-dev.1574+5d96a58f1
Steps to Reproduce and Observed Behavior
run zig build-exe on the following code and then run the compiled code:
const std = @import("std");
const Writer = std.fs.File.Writer;
const Allocator = std.mem.Allocator;
fn printTest(allocator: Allocator, min: usize, max: usize, writer: *Writer) !void {
for (min..max) |i| {
const s = try std.fmt.allocPrint(allocator, "{d:016}", .{i});
_ = try writer.interface.write(s);
_ = try writer.interface.write("\n");
}
}
pub fn main() !void {
// Get allocator
var a = std.heap.ArenaAllocator.init(std.heap.page_allocator);
const allocator = a.allocator();
defer _ = a.deinit();
var buffer: [1024]u8 = undefined;
var writer = std.fs.File.stdout().writer(&buffer);
try printTest(allocator, 1, 65, &writer);
try writer.interface.flush();
}
I see the following output ( line 61 is absent):
0000000000000001
0000000000000002
0000000000000003
0000000000000004
0000000000000005
0000000000000006
0000000000000007
0000000000000008
0000000000000009
0000000000000010
0000000000000011
0000000000000012
0000000000000013
0000000000000014
0000000000000015
0000000000000016
0000000000000017
0000000000000018
0000000000000019
0000000000000020
0000000000000021
0000000000000022
0000000000000023
0000000000000024
0000000000000025
0000000000000026
0000000000000027
0000000000000028
0000000000000029
0000000000000030
0000000000000031
0000000000000032
0000000000000033
0000000000000034
0000000000000035
0000000000000036
0000000000000037
0000000000000038
0000000000000039
0000000000000040
0000000000000041
0000000000000042
0000000000000043
0000000000000044
0000000000000045
0000000000000046
0000000000000047
0000000000000048
0000000000000049
0000000000000050
0000000000000051
0000000000000052
0000000000000053
0000000000000054
0000000000000055
0000000000000056
0000000000000057
0000000000000058
0000000000000059
0000000000000060
0000000000000062
0000000000000063
0000000000000064
Expected Behavior
line 61 is present