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...@@ -390,7 +390,7 @@ fn prepareTables(fuzz: *Fuzz, run_step: *Step.Run, coverage_id: u64) error{ OutO
390 .coverage = std.debug.Coverage.init,390 .coverage = std.debug.Coverage.init,
391 .mapped_memory = undefined, // populated below391 .mapped_memory = undefined, // populated below
392 .source_locations = undefined, // populated below392 .source_locations = undefined, // populated below
393 .entry_points = .{},393 .entry_points = .empty,
394 .start_timestamp = ws.now(),394 .start_timestamp = ws.now(),
395 .start_n_runs = undefined, // populated below395 .start_n_runs = undefined, // populated below
396 };396 };
...@@ -450,7 +450,7 @@ fn prepareTables(fuzz: *Fuzz, run_step: *Step.Run, coverage_id: u64) error{ OutO...@@ -450,7 +450,7 @@ fn prepareTables(fuzz: *Fuzz, run_step: *Step.Run, coverage_id: u64) error{ OutO
450450
451 // Unfortunately the PCs array that LLVM gives us from the 8-bit PC451 // Unfortunately the PCs array that LLVM gives us from the 8-bit PC
452 // counters feature is not sorted.452 // 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;
454 defer sorted_pcs.deinit(gpa);454 defer sorted_pcs.deinit(gpa);
455 try sorted_pcs.resize(gpa, pcs.len);455 try sorted_pcs.resize(gpa, pcs.len);
456 @memcpy(sorted_pcs.items(.pc), pcs);456 @memcpy(sorted_pcs.items(.pc), pcs);
lib/std/Build/Module.zig+7-7
...@@ -275,18 +275,18 @@ pub fn init(...@@ -275,18 +275,18 @@ pub fn init(
275 m.* = .{275 m.* = .{
276 .owner = owner,276 .owner = owner,
277 .root_source_file = if (options.root_source_file) |lp| lp.dupe(owner) else null,277 .root_source_file = if (options.root_source_file) |lp| lp.dupe(owner) else null,
278 .import_table = .{},278 .import_table = .empty,
279 .resolved_target = options.target,279 .resolved_target = options.target,
280 .optimize = options.optimize,280 .optimize = options.optimize,
281 .link_libc = options.link_libc,281 .link_libc = options.link_libc,
282 .link_libcpp = options.link_libcpp,282 .link_libcpp = options.link_libcpp,
283 .dwarf_format = options.dwarf_format,283 .dwarf_format = options.dwarf_format,
284 .c_macros = .{},284 .c_macros = .empty,
285 .include_dirs = .{},285 .include_dirs = .empty,
286 .lib_paths = .{},286 .lib_paths = .empty,
287 .rpaths = .{},287 .rpaths = .empty,
288 .frameworks = .{},288 .frameworks = .empty,
289 .link_objects = .{},289 .link_objects = .empty,
290 .strip = options.strip,290 .strip = options.strip,
291 .unwind_tables = options.unwind_tables,291 .unwind_tables = options.unwind_tables,
292 .single_threaded = options.single_threaded,292 .single_threaded = options.single_threaded,
lib/std/Build/Step.zig+1-1
...@@ -250,7 +250,7 @@ pub fn init(options: StepOptions) Step {...@@ -250,7 +250,7 @@ pub fn init(options: StepOptions) Step {
250 const first_ret_addr = options.first_ret_addr orelse @returnAddress();250 const first_ret_addr = options.first_ret_addr orelse @returnAddress();
251 break :blk std.debug.captureCurrentStackTrace(.{ .first_address = first_ret_addr }, addr_buf);251 break :blk std.debug.captureCurrentStackTrace(.{ .first_address = first_ret_addr }, addr_buf);
252 },252 },
253 .result_error_msgs = .{},253 .result_error_msgs = .empty,
254 .result_error_bundle = std.zig.ErrorBundle.empty,254 .result_error_bundle = std.zig.ErrorBundle.empty,
255 .result_stderr = "",255 .result_stderr = "",
256 .result_cached = false,256 .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 {...@@ -213,13 +213,13 @@ pub fn create(owner: *std.Build, name: []const u8) *Run {
213 .owner = owner,213 .owner = owner,
214 .makeFn = make,214 .makeFn = make,
215 }),215 }),
216 .argv = .{},216 .argv = .empty,
217 .cwd = null,217 .cwd = null,
218 .environ_map = null,218 .environ_map = null,
219 .disable_zig_progress = false,219 .disable_zig_progress = false,
220 .stdio = .infer_from_args,220 .stdio = .infer_from_args,
221 .stdin = .none,221 .stdin = .none,
222 .file_inputs = .{},222 .file_inputs = .empty,
223 .rename_step_with_output_arg = true,223 .rename_step_with_output_arg = true,
224 .skip_foreign_checks = false,224 .skip_foreign_checks = false,
225 .failing_to_execute_foreign_is_an_error = true,225 .failing_to_execute_foreign_is_an_error = true,
...@@ -228,7 +228,7 @@ pub fn create(owner: *std.Build, name: []const u8) *Run {...@@ -228,7 +228,7 @@ pub fn create(owner: *std.Build, name: []const u8) *Run {
228 .captured_stderr = null,228 .captured_stderr = null,
229 .dep_output_file = null,229 .dep_output_file = null,
230 .has_side_effects = false,230 .has_side_effects = false,
231 .fuzz_tests = .{},231 .fuzz_tests = .empty,
232 .rebuilt_executable = null,232 .rebuilt_executable = null,
233 .producer = null,233 .producer = null,
234 };234 };
...@@ -642,7 +642,7 @@ pub fn addCheck(run: *Run, new_check: StdIo.Check) void {...@@ -642,7 +642,7 @@ pub fn addCheck(run: *Run, new_check: StdIo.Check) void {
642642
643 switch (run.stdio) {643 switch (run.stdio) {
644 .infer_from_args => {644 .infer_from_args => {
645 run.stdio = .{ .check = .{} };645 run.stdio = .{ .check = .empty };
646 run.stdio.check.append(b.allocator, new_check) catch @panic("OOM");646 run.stdio.check.append(b.allocator, new_check) catch @panic("OOM");
647 },647 },
648 .check => |*checks| checks.append(b.allocator, new_check) catch @panic("OOM"),648 .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 {...@@ -35,7 +35,7 @@ pub fn create(owner: *std.Build) *UpdateSourceFiles {
35 .owner = owner,35 .owner = owner,
36 .makeFn = make,36 .makeFn = make,
37 }),37 }),
38 .output_source_files = .{},38 .output_source_files = .empty,
39 };39 };
40 return usf;40 return usf;
41}41}
lib/std/Build/Step/WriteFile.zig+2-2
...@@ -94,8 +94,8 @@ pub fn create(owner: *std.Build) *WriteFile {...@@ -94,8 +94,8 @@ pub fn create(owner: *std.Build) *WriteFile {
94 .owner = owner,94 .owner = owner,
95 .makeFn = make,95 .makeFn = make,
96 }),96 }),
97 .files = .{},97 .files = .empty,
98 .directories = .{},98 .directories = .empty,
99 .generated_directory = .{ .step = &write_file.step },99 .generated_directory = .{ .step = &write_file.step },
100 };100 };
101 return write_file;101 return write_file;
lib/std/Io/Dir.zig+1-1
...@@ -334,7 +334,7 @@ pub fn walkSelectively(dir: Dir, allocator: Allocator) !SelectiveWalker {...@@ -334,7 +334,7 @@ pub fn walkSelectively(dir: Dir, allocator: Allocator) !SelectiveWalker {
334334
335 return .{335 return .{
336 .stack = stack,336 .stack = stack,
337 .name_buffer = .{},337 .name_buffer = .empty,
338 .allocator = allocator,338 .allocator = allocator,
339 };339 };
340}340}
lib/std/array_list.zig+2-2
...@@ -582,10 +582,10 @@ pub fn Aligned(comptime T: type, comptime alignment: ?mem.Alignment) type {...@@ -582,10 +582,10 @@ pub fn Aligned(comptime T: type, comptime alignment: ?mem.Alignment) type {
582 /// functions of this ArrayList in accordance with the respective582 /// functions of this ArrayList in accordance with the respective
583 /// documentation. In all cases, "invalidated" means that the memory583 /// documentation. In all cases, "invalidated" means that the memory
584 /// has been passed to an allocator's resize or free function.584 /// has been passed to an allocator's resize or free function.
585 items: Slice = &[_]T{},585 items: Slice,
586 /// How many T values this list can hold without allocating586 /// How many T values this list can hold without allocating
587 /// additional memory.587 /// additional memory.
588 capacity: usize = 0,588 capacity: usize,
589589
590 /// An ArrayList containing no elements.590 /// An ArrayList containing no elements.
591 pub const empty: Self = .{591 pub const empty: Self = .{
lib/std/compress/lzma.zig+1-1
...@@ -349,7 +349,7 @@ pub const Decode = struct {...@@ -349,7 +349,7 @@ pub const Decode = struct {
349349
350 pub fn init(dict_size: usize, mem_limit: usize) CircularBuffer {350 pub fn init(dict_size: usize, mem_limit: usize) CircularBuffer {
351 return .{351 return .{
352 .buf = .{},352 .buf = .empty,
353 .dict_size = dict_size,353 .dict_size = dict_size,
354 .mem_limit = mem_limit,354 .mem_limit = mem_limit,
355 .cursor = 0,355 .cursor = 0,
lib/std/compress/lzma2.zig+1-1
...@@ -16,7 +16,7 @@ pub const AccumBuffer = struct {...@@ -16,7 +16,7 @@ pub const AccumBuffer = struct {
1616
17 pub fn init(memlimit: usize) AccumBuffer {17 pub fn init(memlimit: usize) AccumBuffer {
18 return .{18 return .{
19 .buf = .{},19 .buf = .empty,
20 .memlimit = memlimit,20 .memlimit = memlimit,
21 .len = 0,21 .len = 0,
22 };22 };
lib/std/debug/Coverage.zig+3-3
...@@ -27,10 +27,10 @@ string_bytes: std.ArrayList(u8),...@@ -27,10 +27,10 @@ string_bytes: std.ArrayList(u8),
27mutex: Io.Mutex,27mutex: Io.Mutex,
2828
29pub const init: Coverage = .{29pub const init: Coverage = .{
30 .directories = .{},30 .directories = .empty,
31 .files = .{},31 .files = .empty,
32 .mutex = .init,32 .mutex = .init,
33 .string_bytes = .{},33 .string_bytes = .empty,
34};34};
3535
36pub const String = enum(u32) {36pub const String = enum(u32) {
lib/std/zig/Ast.zig+4-4
...@@ -175,10 +175,10 @@ pub fn parseTokens(...@@ -175,10 +175,10 @@ pub fn parseTokens(
175 .source = source,175 .source = source,
176 .gpa = gpa,176 .gpa = gpa,
177 .tokens = tokens,177 .tokens = tokens,
178 .errors = .{},178 .errors = .empty,
179 .nodes = .{},179 .nodes = .empty,
180 .extra_data = .{},180 .extra_data = .empty,
181 .scratch = .{},181 .scratch = .empty,
182 .tok_i = 0,182 .tok_i = 0,
183 };183 };
184 defer parser.errors.deinit(gpa);184 defer parser.errors.deinit(gpa);
lib/std/zig/AstGen.zig+1-1
...@@ -1780,7 +1780,7 @@ fn structInitExpr(...@@ -1780,7 +1780,7 @@ fn structInitExpr(
1780 try gop.value_ptr.append(sfba_allocator, name_token);1780 try gop.value_ptr.append(sfba_allocator, name_token);
1781 any_duplicate = true;1781 any_duplicate = true;
1782 } else {1782 } else {
1783 gop.value_ptr.* = .{};1783 gop.value_ptr.* = .empty;
1784 try gop.value_ptr.append(sfba_allocator, name_token);1784 try gop.value_ptr.append(sfba_allocator, name_token);
1785 }1785 }
1786 }1786 }
lib/std/zig/ErrorBundle.zig+6-6
...@@ -340,9 +340,9 @@ pub const Wip = struct {...@@ -340,9 +340,9 @@ pub const Wip = struct {
340 pub fn init(wip: *Wip, gpa: Allocator) !void {340 pub fn init(wip: *Wip, gpa: Allocator) !void {
341 wip.* = .{341 wip.* = .{
342 .gpa = gpa,342 .gpa = gpa,
343 .string_bytes = .{},343 .string_bytes = .empty,
344 .extra = .{},344 .extra = .empty,
345 .root_list = .{},345 .root_list = .empty,
346 };346 };
347347
348 // So that 0 can be used to indicate a null string.348 // So that 0 can be used to indicate a null string.
...@@ -371,9 +371,9 @@ pub const Wip = struct {...@@ -371,9 +371,9 @@ pub const Wip = struct {
371 wip.deinit();371 wip.deinit();
372 wip.* = .{372 wip.* = .{
373 .gpa = gpa,373 .gpa = gpa,
374 .string_bytes = .{},374 .string_bytes = .empty,
375 .extra = .{},375 .extra = .empty,
376 .root_list = .{},376 .root_list = .empty,
377 };377 };
378 return empty;378 return empty;
379 }379 }
src/Package/Manifest.zig+3-3
...@@ -66,7 +66,7 @@ pub fn parse(gpa: Allocator, ast: *const Ast, rng: std.Random, options: ParseOpt...@@ -66,7 +66,7 @@ pub fn parse(gpa: Allocator, ast: *const Ast, rng: std.Random, options: ParseOpt
66 .gpa = gpa,66 .gpa = gpa,
67 .ast = ast.*,67 .ast = ast.*,
68 .arena = arena_instance.allocator(),68 .arena = arena_instance.allocator(),
69 .errors = .{},69 .errors = .empty,
7070
71 .name = undefined,71 .name = undefined,
72 .id = 0,72 .id = 0,
...@@ -74,10 +74,10 @@ pub fn parse(gpa: Allocator, ast: *const Ast, rng: std.Random, options: ParseOpt...@@ -74,10 +74,10 @@ pub fn parse(gpa: Allocator, ast: *const Ast, rng: std.Random, options: ParseOpt
74 .version_node = undefined,74 .version_node = undefined,
75 .dependencies = .{},75 .dependencies = .{},
76 .dependencies_node = .none,76 .dependencies_node = .none,
77 .paths = .{},77 .paths = .empty,
78 .allow_missing_paths_field = options.allow_missing_paths_field,78 .allow_missing_paths_field = options.allow_missing_paths_field,
79 .minimum_zig_version = null,79 .minimum_zig_version = null,
80 .buf = .{},80 .buf = .empty,
81 };81 };
82 defer p.buf.deinit(gpa);82 defer p.buf.deinit(gpa);
83 defer p.errors.deinit(gpa);83 defer p.errors.deinit(gpa);