diff options
| author | Josh Holland <josh@inv.alid.pw> | 2020-11-06 18:54:08 +0000 |
|---|---|---|
| committer | Josh Holland <josh@inv.alid.pw> | 2020-11-07 11:15:44 +0000 |
| commit | c25b157ddaede518d92ee2d87ad536a5b6b097de (patch) | |
| tree | 1599c465bab670beb50b63c2a5b9d8f0411fbc9d /src | |
| parent | c9551652b01bf47a94c139846f22c5df85d07283 (diff) | |
| download | zig-c25b157ddaede518d92ee2d87ad536a5b6b097de.tar.gz zig-c25b157ddaede518d92ee2d87ad536a5b6b097de.zip | |
remove deprecated uses of ArrayList.span
Diffstat (limited to 'src')
| -rw-r--r-- | src/libc_installation.zig | 6 | ||||
| -rw-r--r-- | src/main.zig | 6 | ||||
| -rw-r--r-- | src/translate_c.zig | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/libc_installation.zig b/src/libc_installation.zig index b016589f4d..599bc4b141 100644 --- a/src/libc_installation.zig +++ b/src/libc_installation.zig @@ -342,7 +342,7 @@ pub const LibCInstallation = struct { result_buf.shrink(0); try result_buf.outStream().print("{}\\Include\\{}\\ucrt", .{ search.path, search.version }); - var dir = fs.cwd().openDir(result_buf.span(), .{}) catch |err| switch (err) { + var dir = fs.cwd().openDir(result_buf.items, .{}) catch |err| switch (err) { error.FileNotFound, error.NotDir, error.NoDevice, @@ -388,7 +388,7 @@ pub const LibCInstallation = struct { result_buf.shrink(0); try result_buf.outStream().print("{}\\Lib\\{}\\ucrt\\{}", .{ search.path, search.version, arch_sub_dir }); - var dir = fs.cwd().openDir(result_buf.span(), .{}) catch |err| switch (err) { + var dir = fs.cwd().openDir(result_buf.items, .{}) catch |err| switch (err) { error.FileNotFound, error.NotDir, error.NoDevice, @@ -443,7 +443,7 @@ pub const LibCInstallation = struct { const stream = result_buf.outStream(); try stream.print("{}\\Lib\\{}\\um\\{}", .{ search.path, search.version, arch_sub_dir }); - var dir = fs.cwd().openDir(result_buf.span(), .{}) catch |err| switch (err) { + var dir = fs.cwd().openDir(result_buf.items, .{}) catch |err| switch (err) { error.FileNotFound, error.NotDir, error.NoDevice, diff --git a/src/main.zig b/src/main.zig index 7df8cb1eda..8911242b68 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2501,7 +2501,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void { defer fmt.seen.deinit(); defer fmt.out_buffer.deinit(); - for (input_files.span()) |file_path| { + for (input_files.items) |file_path| { // Get the real path here to avoid Windows failing on relative file paths with . or .. in them. const real_path = fs.realpathAlloc(gpa, file_path) catch |err| { fatal("unable to open '{}': {}", .{ file_path, err }); @@ -2681,7 +2681,7 @@ fn printErrMsgToFile( defer text_buf.deinit(); const out_stream = text_buf.outStream(); try parse_error.render(tree.token_ids, out_stream); - const text = text_buf.span(); + const text = text_buf.items; const stream = file.outStream(); try stream.print("{}:{}:{}: error: {}\n", .{ path, start_loc.line + 1, start_loc.column + 1, text }); @@ -2830,7 +2830,7 @@ pub const ClangArgIterator = struct { defer resp_arg_list.deinit(); { errdefer { - for (resp_arg_list.span()) |item| { + for (resp_arg_list.items) |item| { allocator.free(mem.span(item)); } } diff --git a/src/translate_c.zig b/src/translate_c.zig index 91cbbec4b7..27fb46258b 100644 --- a/src/translate_c.zig +++ b/src/translate_c.zig @@ -6566,7 +6566,7 @@ fn parseCUnaryExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!*ast.Nod fn tokenSlice(c: *Context, token: ast.TokenIndex) []u8 { const tok = c.token_locs.items[token]; - const slice = c.source_buffer.span()[tok.start..tok.end]; + const slice = c.source_buffer.items[tok.start..tok.end]; return if (mem.startsWith(u8, slice, "@\"")) slice[2 .. slice.len - 1] else |
