authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-01-29 18:11:19+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-03-10 10:26:08+00:00
log8eefe86939e917e4e85049325bff8c5a43f50f95
tree3983c1618650e027fb6dcff1a916c2f24627c3de
parent187fef209f73336163337474dc02f46c7c89ac3a
signaturelock-open Commit is signed but in an unrecognized format.

std: remove default values from ArrayList

These were deprecated in the 0.14.0 release cycle almost a year ago, so they can definitely be deleted now.

15 files changed, 39 insertions(+), 39 deletions(-)

lib/std/Build/Fuzz.zig+2-2
......@@ -390,7 +390,7 @@ fn prepareTables(fuzz: *Fuzz, run_step: *Step.Run, coverage_id: u64) error{ OutO
390390 .coverage = std.debug.Coverage.init,
391391 .mapped_memory = undefined, // populated below
392392 .source_locations = undefined, // populated below
393 .entry_points = .{},
393 .entry_points = .empty,
394394 .start_timestamp = ws.now(),
395395 .start_n_runs = undefined, // populated below
396396 };
......@@ -450,7 +450,7 @@ fn prepareTables(fuzz: *Fuzz, run_step: *Step.Run, coverage_id: u64) error{ OutO
450450
451451 // Unfortunately the PCs array that LLVM gives us from the 8-bit PC
452452 // counters feature is not sorted.
453 var sorted_pcs: std.MultiArrayList(struct { pc: u64, index: u32, sl: Coverage.SourceLocation }) = .{};
453 var sorted_pcs: std.MultiArrayList(struct { pc: u64, index: u32, sl: Coverage.SourceLocation }) = .empty;
454454 defer sorted_pcs.deinit(gpa);
455455 try sorted_pcs.resize(gpa, pcs.len);
456456 @memcpy(sorted_pcs.items(.pc), pcs);
lib/std/Build/Module.zig+7-7
......@@ -275,18 +275,18 @@ pub fn init(
275275 m.* = .{
276276 .owner = owner,
277277 .root_source_file = if (options.root_source_file) |lp| lp.dupe(owner) else null,
278 .import_table = .{},
278 .import_table = .empty,
279279 .resolved_target = options.target,
280280 .optimize = options.optimize,
281281 .link_libc = options.link_libc,
282282 .link_libcpp = options.link_libcpp,
283283 .dwarf_format = options.dwarf_format,
284 .c_macros = .{},
285 .include_dirs = .{},
286 .lib_paths = .{},
287 .rpaths = .{},
288 .frameworks = .{},
289 .link_objects = .{},
284 .c_macros = .empty,
285 .include_dirs = .empty,
286 .lib_paths = .empty,
287 .rpaths = .empty,
288 .frameworks = .empty,
289 .link_objects = .empty,
290290 .strip = options.strip,
291291 .unwind_tables = options.unwind_tables,
292292 .single_threaded = options.single_threaded,
lib/std/Build/Step.zig+1-1
......@@ -250,7 +250,7 @@ pub fn init(options: StepOptions) Step {
250250 const first_ret_addr = options.first_ret_addr orelse @returnAddress();
251251 break :blk std.debug.captureCurrentStackTrace(.{ .first_address = first_ret_addr }, addr_buf);
252252 },
253 .result_error_msgs = .{},
253 .result_error_msgs = .empty,
254254 .result_error_bundle = std.zig.ErrorBundle.empty,
255255 .result_stderr = "",
256256 .result_cached = false,
lib/std/Build/Step/Run.zig+4-4
......@@ -213,13 +213,13 @@ pub fn create(owner: *std.Build, name: []const u8) *Run {
213213 .owner = owner,
214214 .makeFn = make,
215215 }),
216 .argv = .{},
216 .argv = .empty,
217217 .cwd = null,
218218 .environ_map = null,
219219 .disable_zig_progress = false,
220220 .stdio = .infer_from_args,
221221 .stdin = .none,
222 .file_inputs = .{},
222 .file_inputs = .empty,
223223 .rename_step_with_output_arg = true,
224224 .skip_foreign_checks = false,
225225 .failing_to_execute_foreign_is_an_error = true,
......@@ -228,7 +228,7 @@ pub fn create(owner: *std.Build, name: []const u8) *Run {
228228 .captured_stderr = null,
229229 .dep_output_file = null,
230230 .has_side_effects = false,
231 .fuzz_tests = .{},
231 .fuzz_tests = .empty,
232232 .rebuilt_executable = null,
233233 .producer = null,
234234 };
......@@ -642,7 +642,7 @@ pub fn addCheck(run: *Run, new_check: StdIo.Check) void {
642642
643643 switch (run.stdio) {
644644 .infer_from_args => {
645 run.stdio = .{ .check = .{} };
645 run.stdio = .{ .check = .empty };
646646 run.stdio.check.append(b.allocator, new_check) catch @panic("OOM");
647647 },
648648 .check => |*checks| checks.append(b.allocator, new_check) catch @panic("OOM"),
lib/std/Build/Step/UpdateSourceFiles.zig+1-1
......@@ -35,7 +35,7 @@ pub fn create(owner: *std.Build) *UpdateSourceFiles {
3535 .owner = owner,
3636 .makeFn = make,
3737 }),
38 .output_source_files = .{},
38 .output_source_files = .empty,
3939 };
4040 return usf;
4141}
lib/std/Build/Step/WriteFile.zig+2-2
......@@ -94,8 +94,8 @@ pub fn create(owner: *std.Build) *WriteFile {
9494 .owner = owner,
9595 .makeFn = make,
9696 }),
97 .files = .{},
98 .directories = .{},
97 .files = .empty,
98 .directories = .empty,
9999 .generated_directory = .{ .step = &write_file.step },
100100 };
101101 return write_file;
lib/std/Io/Dir.zig+1-1
......@@ -334,7 +334,7 @@ pub fn walkSelectively(dir: Dir, allocator: Allocator) !SelectiveWalker {
334334
335335 return .{
336336 .stack = stack,
337 .name_buffer = .{},
337 .name_buffer = .empty,
338338 .allocator = allocator,
339339 };
340340}
lib/std/array_list.zig+2-2
......@@ -582,10 +582,10 @@ pub fn Aligned(comptime T: type, comptime alignment: ?mem.Alignment) type {
582582 /// functions of this ArrayList in accordance with the respective
583583 /// documentation. In all cases, "invalidated" means that the memory
584584 /// has been passed to an allocator's resize or free function.
585 items: Slice = &[_]T{},
585 items: Slice,
586586 /// How many T values this list can hold without allocating
587587 /// additional memory.
588 capacity: usize = 0,
588 capacity: usize,
589589
590590 /// An ArrayList containing no elements.
591591 pub const empty: Self = .{
lib/std/compress/lzma.zig+1-1
......@@ -349,7 +349,7 @@ pub const Decode = struct {
349349
350350 pub fn init(dict_size: usize, mem_limit: usize) CircularBuffer {
351351 return .{
352 .buf = .{},
352 .buf = .empty,
353353 .dict_size = dict_size,
354354 .mem_limit = mem_limit,
355355 .cursor = 0,
lib/std/compress/lzma2.zig+1-1
......@@ -16,7 +16,7 @@ pub const AccumBuffer = struct {
1616
1717 pub fn init(memlimit: usize) AccumBuffer {
1818 return .{
19 .buf = .{},
19 .buf = .empty,
2020 .memlimit = memlimit,
2121 .len = 0,
2222 };
lib/std/debug/Coverage.zig+3-3
......@@ -27,10 +27,10 @@ string_bytes: std.ArrayList(u8),
2727mutex: Io.Mutex,
2828
2929pub const init: Coverage = .{
30 .directories = .{},
31 .files = .{},
30 .directories = .empty,
31 .files = .empty,
3232 .mutex = .init,
33 .string_bytes = .{},
33 .string_bytes = .empty,
3434};
3535
3636pub const String = enum(u32) {
lib/std/zig/Ast.zig+4-4
......@@ -175,10 +175,10 @@ pub fn parseTokens(
175175 .source = source,
176176 .gpa = gpa,
177177 .tokens = tokens,
178 .errors = .{},
179 .nodes = .{},
180 .extra_data = .{},
181 .scratch = .{},
178 .errors = .empty,
179 .nodes = .empty,
180 .extra_data = .empty,
181 .scratch = .empty,
182182 .tok_i = 0,
183183 };
184184 defer parser.errors.deinit(gpa);
lib/std/zig/AstGen.zig+1-1
......@@ -1780,7 +1780,7 @@ fn structInitExpr(
17801780 try gop.value_ptr.append(sfba_allocator, name_token);
17811781 any_duplicate = true;
17821782 } else {
1783 gop.value_ptr.* = .{};
1783 gop.value_ptr.* = .empty;
17841784 try gop.value_ptr.append(sfba_allocator, name_token);
17851785 }
17861786 }
lib/std/zig/ErrorBundle.zig+6-6
......@@ -340,9 +340,9 @@ pub const Wip = struct {
340340 pub fn init(wip: *Wip, gpa: Allocator) !void {
341341 wip.* = .{
342342 .gpa = gpa,
343 .string_bytes = .{},
344 .extra = .{},
345 .root_list = .{},
343 .string_bytes = .empty,
344 .extra = .empty,
345 .root_list = .empty,
346346 };
347347
348348 // So that 0 can be used to indicate a null string.
......@@ -371,9 +371,9 @@ pub const Wip = struct {
371371 wip.deinit();
372372 wip.* = .{
373373 .gpa = gpa,
374 .string_bytes = .{},
375 .extra = .{},
376 .root_list = .{},
374 .string_bytes = .empty,
375 .extra = .empty,
376 .root_list = .empty,
377377 };
378378 return empty;
379379 }
src/Package/Manifest.zig+3-3
......@@ -66,7 +66,7 @@ pub fn parse(gpa: Allocator, ast: *const Ast, rng: std.Random, options: ParseOpt
6666 .gpa = gpa,
6767 .ast = ast.*,
6868 .arena = arena_instance.allocator(),
69 .errors = .{},
69 .errors = .empty,
7070
7171 .name = undefined,
7272 .id = 0,
......@@ -74,10 +74,10 @@ pub fn parse(gpa: Allocator, ast: *const Ast, rng: std.Random, options: ParseOpt
7474 .version_node = undefined,
7575 .dependencies = .{},
7676 .dependencies_node = .none,
77 .paths = .{},
77 .paths = .empty,
7878 .allow_missing_paths_field = options.allow_missing_paths_field,
7979 .minimum_zig_version = null,
80 .buf = .{},
80 .buf = .empty,
8181 };
8282 defer p.buf.deinit(gpa);
8383 defer p.errors.deinit(gpa);