Skip to content

Commit 4b5351b

Browse files
authored
update deprecated ArrayListUnmanaged usage (#25958)
1 parent db622f1 commit 4b5351b

File tree

112 files changed

+630
-631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+630
-631
lines changed

doc/langref/test_switch_dispatch_loop.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Instruction = enum {
99

1010
fn evaluate(initial_stack: []const i32, code: []const Instruction) !i32 {
1111
var buffer: [8]i32 = undefined;
12-
var stack = std.ArrayListUnmanaged(i32).initBuffer(&buffer);
12+
var stack = std.ArrayList(i32).initBuffer(&buffer);
1313
try stack.appendSliceBounded(initial_stack);
1414
var ip: usize = 0;
1515

lib/build-web/fuzz.zig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn sourceIndexMessage(msg_bytes: []u8) error{OutOfMemory}!void {
4242

4343
var coverage = Coverage.init;
4444
/// Index of type `SourceLocationIndex`.
45-
var coverage_source_locations: std.ArrayListUnmanaged(Coverage.SourceLocation) = .empty;
45+
var coverage_source_locations: std.ArrayList(Coverage.SourceLocation) = .empty;
4646
/// Contains the most recent coverage update message, unmodified.
4747
var recent_coverage_update: std.ArrayListAlignedUnmanaged(u8, .of(u64)) = .empty;
4848

@@ -76,7 +76,7 @@ pub fn coverageUpdateMessage(msg_bytes: []u8) error{OutOfMemory}!void {
7676
try updateCoverage();
7777
}
7878

79-
var entry_points: std.ArrayListUnmanaged(SourceLocationIndex) = .empty;
79+
var entry_points: std.ArrayList(SourceLocationIndex) = .empty;
8080

8181
pub fn entryPointsMessage(msg_bytes: []u8) error{OutOfMemory}!void {
8282
const header: abi.fuzz.EntryPointHeader = @bitCast(msg_bytes[0..@sizeOf(abi.fuzz.EntryPointHeader)].*);
@@ -127,19 +127,19 @@ const SourceLocationIndex = enum(u32) {
127127
}
128128

129129
fn toWalkFile(sli: SourceLocationIndex) ?Walk.File.Index {
130-
var buf: std.ArrayListUnmanaged(u8) = .empty;
130+
var buf: std.ArrayList(u8) = .empty;
131131
defer buf.deinit(gpa);
132132
sli.appendPath(&buf) catch @panic("OOM");
133133
return @enumFromInt(Walk.files.getIndex(buf.items) orelse return null);
134134
}
135135

136136
fn fileHtml(
137137
sli: SourceLocationIndex,
138-
out: *std.ArrayListUnmanaged(u8),
138+
out: *std.ArrayList(u8),
139139
) error{ OutOfMemory, SourceUnavailable }!void {
140140
const walk_file_index = sli.toWalkFile() orelse return error.SourceUnavailable;
141141
const root_node = walk_file_index.findRootDecl().get().ast_node;
142-
var annotations: std.ArrayListUnmanaged(html_render.Annotation) = .empty;
142+
var annotations: std.ArrayList(html_render.Annotation) = .empty;
143143
defer annotations.deinit(gpa);
144144
try computeSourceAnnotations(sli.ptr().file, walk_file_index, &annotations, coverage_source_locations.items);
145145
html_render.fileSourceHtml(walk_file_index, out, root_node, .{
@@ -153,13 +153,13 @@ const SourceLocationIndex = enum(u32) {
153153
fn computeSourceAnnotations(
154154
cov_file_index: Coverage.File.Index,
155155
walk_file_index: Walk.File.Index,
156-
annotations: *std.ArrayListUnmanaged(html_render.Annotation),
156+
annotations: *std.ArrayList(html_render.Annotation),
157157
source_locations: []const Coverage.SourceLocation,
158158
) !void {
159159
// Collect all the source locations from only this file into this array
160160
// first, then sort by line, col, so that we can collect annotations with
161161
// O(N) time complexity.
162-
var locs: std.ArrayListUnmanaged(SourceLocationIndex) = .empty;
162+
var locs: std.ArrayList(SourceLocationIndex) = .empty;
163163
defer locs.deinit(gpa);
164164

165165
for (source_locations, 0..) |sl, sli_usize| {
@@ -309,7 +309,7 @@ fn updateCoverage() error{OutOfMemory}!void {
309309
if (recent_coverage_update.items.len == 0) return;
310310
const want_file = (selected_source_location orelse return).ptr().file;
311311

312-
var covered: std.ArrayListUnmanaged(SourceLocationIndex) = .empty;
312+
var covered: std.ArrayList(SourceLocationIndex) = .empty;
313313
defer covered.deinit(gpa);
314314

315315
// This code assumes 64-bit elements, which is incorrect if the executable
@@ -340,7 +340,7 @@ fn updateCoverage() error{OutOfMemory}!void {
340340
fn updateSource() error{OutOfMemory}!void {
341341
if (recent_coverage_update.items.len == 0) return;
342342
const file_sli = selected_source_location.?;
343-
var html: std.ArrayListUnmanaged(u8) = .empty;
343+
var html: std.ArrayList(u8) = .empty;
344344
defer html.deinit(gpa);
345345
file_sli.fileHtml(&html) catch |err| switch (err) {
346346
error.OutOfMemory => |e| return e,

lib/build-web/time_report.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pub fn runTestResultMessage(msg_bytes: []u8) error{OutOfMemory}!void {
254254
const durations: []align(1) const u64 = @ptrCast(trailing[0 .. hdr.tests_len * 8]);
255255
var offset: usize = hdr.tests_len * 8;
256256

257-
var table_html: std.ArrayListUnmanaged(u8) = .empty;
257+
var table_html: std.ArrayList(u8) = .empty;
258258
defer table_html.deinit(gpa);
259259

260260
for (durations) |test_ns| {

lib/compiler/build_runner.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ pub fn main() !void {
459459
}
460460

461461
if (graph.needed_lazy_dependencies.entries.len != 0) {
462-
var buffer: std.ArrayListUnmanaged(u8) = .empty;
462+
var buffer: std.ArrayList(u8) = .empty;
463463
for (graph.needed_lazy_dependencies.keys()) |k| {
464464
try buffer.appendSlice(arena, k);
465465
try buffer.append(arena, '\n');
@@ -672,7 +672,7 @@ const Run = struct {
672672
watch: bool,
673673
web_server: if (!builtin.single_threaded) ?WebServer else ?noreturn,
674674
/// Allocated into `gpa`.
675-
memory_blocked_steps: std.ArrayListUnmanaged(*Step),
675+
memory_blocked_steps: std.ArrayList(*Step),
676676
/// Allocated into `gpa`.
677677
step_stack: std.AutoArrayHashMapUnmanaged(*Step, void),
678678
thread_pool: std.Thread.Pool,
@@ -1468,7 +1468,7 @@ pub fn printErrorMessages(
14681468
if (error_style.verboseContext()) {
14691469
// Provide context for where these error messages are coming from by
14701470
// printing the corresponding Step subtree.
1471-
var step_stack: std.ArrayListUnmanaged(*Step) = .empty;
1471+
var step_stack: std.ArrayList(*Step) = .empty;
14721472
defer step_stack.deinit(gpa);
14731473
try step_stack.append(gpa, failing_step);
14741474
while (step_stack.items[step_stack.items.len - 1].dependants.items.len != 0) {

lib/compiler/objcopy.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ const BinaryElfSegment = struct {
381381
};
382382

383383
const BinaryElfOutput = struct {
384-
segments: std.ArrayListUnmanaged(*BinaryElfSegment),
385-
sections: std.ArrayListUnmanaged(*BinaryElfSection),
384+
segments: std.ArrayList(*BinaryElfSegment),
385+
sections: std.ArrayList(*BinaryElfSection),
386386
allocator: Allocator,
387387
shstrtab: ?[]const u8,
388388

lib/compiler/reduce.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub fn main() !void {
109109
const root_source_file_path = opt_root_source_file_path orelse
110110
fatal("missing root source file path argument; see -h for usage", .{});
111111

112-
var interestingness_argv: std.ArrayListUnmanaged([]const u8) = .empty;
112+
var interestingness_argv: std.ArrayList([]const u8) = .empty;
113113
try interestingness_argv.ensureUnusedCapacity(arena, argv.len + 1);
114114
interestingness_argv.appendAssumeCapacity(checker_path);
115115
interestingness_argv.appendSliceAssumeCapacity(argv);

lib/compiler/reduce/Walk.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub const Transformation = union(enum) {
2323
delete_var_decl: struct {
2424
var_decl_node: Ast.Node.Index,
2525
/// Identifier nodes that reference the variable.
26-
references: std.ArrayListUnmanaged(Ast.Node.Index),
26+
references: std.ArrayList(Ast.Node.Index),
2727
},
2828
/// Replace an expression with `undefined`.
2929
replace_with_undef: Ast.Node.Index,

lib/compiler/std-docs.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ fn buildWasmBinary(
284284
) !Cache.Path {
285285
const gpa = context.gpa;
286286

287-
var argv: std.ArrayListUnmanaged([]const u8) = .empty;
287+
var argv: std.ArrayList([]const u8) = .empty;
288288

289289
try argv.appendSlice(arena, &.{
290290
context.zig_exe_path, //

lib/compiler/test_runner.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn mainServer() !void {
104104
@panic("internal test runner memory leak");
105105
};
106106

107-
var string_bytes: std.ArrayListUnmanaged(u8) = .empty;
107+
var string_bytes: std.ArrayList(u8) = .empty;
108108
defer string_bytes.deinit(testing.allocator);
109109
try string_bytes.append(testing.allocator, 0); // Reserve 0 for null.
110110

lib/docs/wasm/Walk.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Oom = error{OutOfMemory};
1111
pub const Decl = @import("Decl.zig");
1212

1313
pub var files: std.StringArrayHashMapUnmanaged(File) = .empty;
14-
pub var decls: std.ArrayListUnmanaged(Decl) = .empty;
14+
pub var decls: std.ArrayList(Decl) = .empty;
1515
pub var modules: std.StringArrayHashMapUnmanaged(File.Index) = .empty;
1616

1717
file: File.Index,

0 commit comments

Comments
 (0)