diff options
| author | Benjamin Jurk <106487517+bnjmnjrk@users.noreply.github.com> | 2025-11-20 23:46:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-20 14:46:23 -0800 |
| commit | 4b5351bc0ddc248d6935d7d160a57cb4dfe4dedd (patch) | |
| tree | 8ce84d4e44a8ee1abaf0ef71d8287cec4b0f8c0a /src/main.zig | |
| parent | db622f14c445b4f55981636543c546e22346abd5 (diff) | |
| download | zig-4b5351bc0ddc248d6935d7d160a57cb4dfe4dedd.tar.gz zig-4b5351bc0ddc248d6935d7d160a57cb4dfe4dedd.zip | |
update deprecated ArrayListUnmanaged usage (#25958)
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/main.zig b/src/main.zig index d52616aa77..21bbecea4a 100644 --- a/src/main.zig +++ b/src/main.zig @@ -132,7 +132,7 @@ const debug_usage = normal_usage ++ const usage = if (build_options.enable_debug_extensions) debug_usage else normal_usage; -var log_scopes: std.ArrayListUnmanaged([]const u8) = .empty; +var log_scopes: std.ArrayList([]const u8) = .empty; pub fn log( comptime level: std.log.Level, @@ -884,7 +884,7 @@ fn buildOutputType( var link_emit_relocs = false; var build_id: ?std.zig.BuildId = null; var runtime_args_start: ?usize = null; - var test_filters: std.ArrayListUnmanaged([]const u8) = .empty; + var test_filters: std.ArrayList([]const u8) = .empty; var test_runner_path: ?[]const u8 = null; var override_local_cache_dir: ?[]const u8 = try EnvVar.ZIG_LOCAL_CACHE_DIR.get(arena); var override_global_cache_dir: ?[]const u8 = try EnvVar.ZIG_GLOBAL_CACHE_DIR.get(arena); @@ -912,12 +912,12 @@ fn buildOutputType( var pdb_out_path: ?[]const u8 = null; var error_limit: ?Zcu.ErrorInt = null; // These are before resolving sysroot. - var extra_cflags: std.ArrayListUnmanaged([]const u8) = .empty; - var extra_rcflags: std.ArrayListUnmanaged([]const u8) = .empty; + var extra_cflags: std.ArrayList([]const u8) = .empty; + var extra_rcflags: std.ArrayList([]const u8) = .empty; var symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .empty; var rc_includes: std.zig.RcIncludes = .any; var manifest_file: ?[]const u8 = null; - var linker_export_symbol_names: std.ArrayListUnmanaged([]const u8) = .empty; + var linker_export_symbol_names: std.ArrayList([]const u8) = .empty; // Tracks the position in c_source_files which have already their owner populated. var c_source_files_owner_index: usize = 0; @@ -925,7 +925,7 @@ fn buildOutputType( var rc_source_files_owner_index: usize = 0; // null means replace with the test executable binary - var test_exec_args: std.ArrayListUnmanaged(?[]const u8) = .empty; + var test_exec_args: std.ArrayList(?[]const u8) = .empty; // These get set by CLI flags and then snapshotted when a `-M` flag is // encountered. @@ -934,8 +934,8 @@ fn buildOutputType( // These get appended to by CLI flags and then slurped when a `-M` flag // is encountered. var cssan: ClangSearchSanitizer = .{}; - var cc_argv: std.ArrayListUnmanaged([]const u8) = .empty; - var deps: std.ArrayListUnmanaged(CliModule.Dep) = .empty; + var cc_argv: std.ArrayList([]const u8) = .empty; + var deps: std.ArrayList(CliModule.Dep) = .empty; // Contains every module specified via -M. The dependencies are added // after argument parsing is completed. We use a StringArrayHashMap to make @@ -3374,7 +3374,7 @@ fn buildOutputType( process.raiseFileDescriptorLimit(); - var file_system_inputs: std.ArrayListUnmanaged(u8) = .empty; + var file_system_inputs: std.ArrayList(u8) = .empty; defer file_system_inputs.deinit(gpa); // Deduplicate rpath entries @@ -3698,29 +3698,29 @@ const CreateModule = struct { /// directly after computing the target and used to compute link_libc, /// link_libcpp, and then the libraries are filtered into /// `unresolved_link_inputs` and `windows_libs`. - cli_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput), + cli_link_inputs: std.ArrayList(link.UnresolvedInput), windows_libs: std.StringArrayHashMapUnmanaged(void), /// The local variable `unresolved_link_inputs` is fed into library /// resolution, mutating the input array, and producing this data as /// output. Allocated with gpa. - link_inputs: std.ArrayListUnmanaged(link.Input), + link_inputs: std.ArrayList(link.Input), - c_source_files: std.ArrayListUnmanaged(Compilation.CSourceFile), - rc_source_files: std.ArrayListUnmanaged(Compilation.RcSourceFile), + c_source_files: std.ArrayList(Compilation.CSourceFile), + rc_source_files: std.ArrayList(Compilation.RcSourceFile), /// e.g. -m3dnow or -mno-outline-atomics. They correspond to std.Target llvm cpu feature names. /// This array is populated by zig cc frontend and then has to be converted to zig-style /// CPU features. - llvm_m_args: std.ArrayListUnmanaged([]const u8), + llvm_m_args: std.ArrayList([]const u8), sysroot: ?[]const u8, - lib_directories: std.ArrayListUnmanaged(Directory), - lib_dir_args: std.ArrayListUnmanaged([]const u8), + lib_directories: std.ArrayList(Directory), + lib_dir_args: std.ArrayList([]const u8), libc_installation: ?LibCInstallation, want_native_include_dirs: bool, frameworks: std.StringArrayHashMapUnmanaged(Framework), native_system_include_paths: []const []const u8, - framework_dirs: std.ArrayListUnmanaged([]const u8), - rpath_list: std.ArrayListUnmanaged([]const u8), + framework_dirs: std.ArrayList([]const u8), + rpath_list: std.ArrayList([]const u8), each_lib_rpath: ?bool, libc_paths_file: ?[]const u8, }; @@ -3826,7 +3826,7 @@ fn createModule( // We need to know whether the set of system libraries contains anything besides these // to decide whether to trigger native path detection logic. // Preserves linker input order. - var unresolved_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput) = .empty; + var unresolved_link_inputs: std.ArrayList(link.UnresolvedInput) = .empty; defer unresolved_link_inputs.deinit(gpa); try unresolved_link_inputs.ensureUnusedCapacity(gpa, create_module.cli_link_inputs.items.len); var any_name_queries_remaining = false; @@ -4215,11 +4215,11 @@ fn serveUpdateResults(s: *Server, comp: *Compilation) !void { if (comp.time_report) |*tr| { var decls_len: u32 = 0; - var file_name_bytes: std.ArrayListUnmanaged(u8) = .empty; + var file_name_bytes: std.ArrayList(u8) = .empty; defer file_name_bytes.deinit(gpa); var files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, void) = .empty; defer files.deinit(gpa); - var decl_data: std.ArrayListUnmanaged(u8) = .empty; + var decl_data: std.ArrayList(u8) = .empty; defer decl_data.deinit(gpa); // Each decl needs at least 34 bytes: @@ -4546,7 +4546,7 @@ fn cmdTranslateC( comp: *Compilation, arena: Allocator, fancy_output: ?*Compilation.CImportResult, - file_system_inputs: ?*std.ArrayListUnmanaged(u8), + file_system_inputs: ?*std.ArrayList(u8), prog_node: std.Progress.Node, ) !void { dev.check(.translate_c_command); @@ -4754,7 +4754,7 @@ fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { } fn sanitizeExampleName(arena: Allocator, bytes: []const u8) error{OutOfMemory}![]const u8 { - var result: std.ArrayListUnmanaged(u8) = .empty; + var result: std.ArrayList(u8) = .empty; for (bytes, 0..) |byte, i| switch (byte) { '0'...'9' => { if (i == 0) try result.append(arena, '_'); @@ -5486,7 +5486,7 @@ fn jitCmd( }); defer thread_pool.deinit(); - var child_argv: std.ArrayListUnmanaged([]const u8) = .empty; + var child_argv: std.ArrayList([]const u8) = .empty; try child_argv.ensureUnusedCapacity(arena, args.len + 4); // We want to release all the locks before executing the child process, so we make a nice @@ -6687,7 +6687,7 @@ const ClangSearchSanitizer = struct { fn addIncludePath( self: *@This(), ally: Allocator, - argv: *std.ArrayListUnmanaged([]const u8), + argv: *std.ArrayList([]const u8), group: Group, arg: []const u8, dir: []const u8, @@ -7436,10 +7436,10 @@ fn handleModArg( opt_root_src_orig: ?[]const u8, create_module: *CreateModule, mod_opts: *Package.Module.CreateOptions.Inherited, - cc_argv: *std.ArrayListUnmanaged([]const u8), + cc_argv: *std.ArrayList([]const u8), target_arch_os_abi: *?[]const u8, target_mcpu: *?[]const u8, - deps: *std.ArrayListUnmanaged(CliModule.Dep), + deps: *std.ArrayList(CliModule.Dep), c_source_files_owner_index: *usize, rc_source_files_owner_index: *usize, cssan: *ClangSearchSanitizer, @@ -7513,12 +7513,12 @@ fn anyObjectLinkInputs(link_inputs: []const link.UnresolvedInput) bool { return false; } -fn addLibDirectoryWarn(lib_directories: *std.ArrayListUnmanaged(Directory), path: []const u8) void { +fn addLibDirectoryWarn(lib_directories: *std.ArrayList(Directory), path: []const u8) void { return addLibDirectoryWarn2(lib_directories, path, false); } fn addLibDirectoryWarn2( - lib_directories: *std.ArrayListUnmanaged(Directory), + lib_directories: *std.ArrayList(Directory), path: []const u8, ignore_not_found: bool, ) void { |
