Skip to content

Commit 0f0771c

Browse files
authored
remove usage of deprecated standard library APIs (#2404)
No minimum Zig version bump is necessary because the changes are backwards compatible.
1 parent c5ec270 commit 0f0771c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/analyser/InternPool.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3813,7 +3813,7 @@ pub fn toInt(ip: *InternPool, val: Index, comptime T: type) ?T {
38133813
},
38143814
.int_u64_value => |int_value| std.math.cast(T, int_value.int),
38153815
.int_i64_value => |int_value| std.math.cast(T, int_value.int),
3816-
.int_big_value => |int_value| int_value.getConst(ip).to(T) catch null,
3816+
.int_big_value => |int_value| int_value.getConst(ip).toInt(T) catch null,
38173817
.null_value => 0,
38183818
else => null,
38193819
};

src/build_runner/shared.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub const BuildConfig = struct {
1818
name: []const u8,
1919
path: []const u8,
2020
};
21-
pub const AvailableOption = std.meta.FieldType(std.meta.FieldType(std.Build, .available_options_map).KV, .value);
21+
pub const AvailableOption = @FieldType(@FieldType(std.Build, "available_options_map").KV, "value");
2222
};
2323

2424
pub const Transport = struct {
@@ -145,7 +145,7 @@ pub const ServerToClient = struct {
145145

146146
pub const BuildOnSaveSupport = union(enum) {
147147
supported,
148-
invalid_linux_kernel_version: if (builtin.os.tag == .linux) std.meta.FieldType(std.posix.utsname, .release) else noreturn,
148+
invalid_linux_kernel_version: if (builtin.os.tag == .linux) @FieldType(std.posix.utsname, "release") else noreturn,
149149
unsupported_linux_kernel_version: if (builtin.os.tag == .linux) std.SemanticVersion else noreturn,
150150
unsupported_zig_version: if (@TypeOf(os_support) == std.SemanticVersion) void else noreturn,
151151
unsupported_os: if (@TypeOf(os_support) == bool and !os_support) void else noreturn,

src/features/completions.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ fn declToCompletion(builder: *Builder, decl_handle: Analyser.DeclWithHandle) err
173173
}
174174
}
175175

176-
const documentation: std.meta.FieldType(types.CompletionItem, .documentation) = .{
176+
const documentation: @FieldType(types.CompletionItem, "documentation") = .{
177177
.MarkupContent = .{
178178
.kind = if (builder.server.client_capabilities.completion_doc_supports_md) .markdown else .plaintext,
179179
.value = try std.mem.join(builder.arena, "\n\n", doc_comments.constSlice()),

0 commit comments

Comments
 (0)