std.ArrayList(T).initCapacity() is a pre-0.16 API removed in Zig 0.16initCapacity — API still exists, code changed for consistencyFiles: src/cfg.zig:368, src/grid.zig:910,916
Severity: HIGH (false positive on deprecation, code change retained)
Status: ✅ FIXED (code changed, but API not deprecated)
Verification: A standalone test confirms initCapacity works without deprecation warnings:
test "ArrayList initCapacity still works" {
var list = try std.ArrayList(u32).initCapacity(testing.allocator, 10);
defer list.deinit(testing.allocator);
try list.append(testing.allocator, 1);
}
Result: passes, zero deprecation warnings.
Evidence from std lib source (array_list.zig):
pub fn initCapacity(gpa: Allocator, num: usize) Allocator.Error!Self — present in both managed and unmanaged variantsinitCapacity, and deinitialize with deinit or use toOwnedSlice.”@deprecate annotation on initCapacityThe only deprecation notice is a doc comment: “Default initialization of this struct is deprecated; use .empty instead.” — this refers to = .{} vs = .empty, not to initCapacity.
Code change retained: The three call sites were changed from initCapacity to = .empty + ensureTotalCapacity. While initCapacity is not deprecated, the new pattern is consistent with the rest of the codebase and the 0.16 style guide recommendation to use .empty for unmanaged containers.