Task
In src/tri/self_hosting_loop.zig lines 199-200, ArrayList initialization uses catch unreachable:
.target_files = std.ArrayList([]const u8).initCapacity(allocator, 0) catch unreachable,
.patch_history = std.ArrayList(SelfPatch).initCapacity(allocator, 0) catch unreachable,
Allocation can fail. Use try instead.
Fix
.target_files = try std.ArrayList([]const u8).initCapacity(allocator, 0),
.patch_history = try std.ArrayList(SelfPatch).initCapacity(allocator, 0),
Ensure the enclosing function returns an error union if needed.
File
src/tri/self_hosting_loop.zig — lines 199-200
Acceptance
zig build compiles without errors
zig fmt passes
- No
catch unreachable on ArrayList init
Task
In
src/tri/self_hosting_loop.ziglines 199-200, ArrayList initialization usescatch unreachable:Allocation can fail. Use
tryinstead.Fix
Ensure the enclosing function returns an error union if needed.
File
src/tri/self_hosting_loop.zig— lines 199-200Acceptance
zig buildcompiles without errorszig fmtpassescatch unreachableon ArrayList init