fix std lib tests

This commit is contained in:
Andrew Kelley 2023-12-03 12:32:58 -07:00
parent dd45095ba1
commit ad385649b9
2 changed files with 7 additions and 2 deletions

View File

@ -294,7 +294,12 @@ test Options {
var arena = std.heap.ArenaAllocator.init(std.testing.allocator); var arena = std.heap.ArenaAllocator.init(std.testing.allocator);
defer arena.deinit(); defer arena.deinit();
const host = try std.zig.system.NativeTargetInfo.detect(.{}); const detected = try std.zig.system.NativeTargetInfo.detect(.{});
const host: std.Build.ResolvedTarget = .{
.query = .{},
.target = detected.target,
.dynamic_linker = detected.dynamic_linker,
};
var cache: std.Build.Cache = .{ var cache: std.Build.Cache = .{
.gpa = arena.allocator(), .gpa = arena.allocator(),

View File

@ -212,7 +212,7 @@ pub const BuildId = union(enum) {
hexstring: HexString, hexstring: HexString,
pub fn eql(a: BuildId, b: BuildId) bool { pub fn eql(a: BuildId, b: BuildId) bool {
const Tag = @TypeOf(BuildId).Union.tag_type.?; const Tag = @typeInfo(BuildId).Union.tag_type.?;
const a_tag: Tag = a; const a_tag: Tag = a;
const b_tag: Tag = b; const b_tag: Tag = b;
if (a_tag != b_tag) return false; if (a_tag != b_tag) return false;