zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 28986a059075c2dce662c2f4e823b3efd283df87 (tree)
parent a224dfceee07a94d961506122a434563129428a5
Author: Veikka Tuominen <git@vexu.eu>
Date:   Fri, 17 Jun 2022 18:53:40 +0300

stage2: check that struct is a tuple when value tags differ in eql

Diffstat:
Mlib/std/bit_set.zig | 4----
Msrc/value.zig | 2+-
2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/std/bit_set.zig b/lib/std/bit_set.zig @@ -1330,7 +1330,6 @@ fn testStaticBitSet(comptime Set: type) !void { } test "IntegerBitSet" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO try testStaticBitSet(IntegerBitSet(0)); try testStaticBitSet(IntegerBitSet(1)); try testStaticBitSet(IntegerBitSet(2)); @@ -1342,7 +1341,6 @@ test "IntegerBitSet" { } test "ArrayBitSet" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO if (@import("builtin").cpu.arch == .aarch64) { // https://github.com/ziglang/zig/issues/9879 return error.SkipZigTest; @@ -1357,7 +1355,6 @@ test "ArrayBitSet" { } test "DynamicBitSetUnmanaged" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO const allocator = std.testing.allocator; var a = try DynamicBitSetUnmanaged.initEmpty(allocator, 300); try testing.expectEqual(@as(usize, 0), a.count()); @@ -1398,7 +1395,6 @@ test "DynamicBitSetUnmanaged" { } test "DynamicBitSet" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO const allocator = std.testing.allocator; var a = try DynamicBitSet.initEmpty(allocator, 300); try testing.expectEqual(@as(usize, 0), a.count()); diff --git a/src/value.zig b/src/value.zig @@ -2186,7 +2186,7 @@ pub const Value = extern union { // A tuple can be represented with .empty_struct_value, // the_one_possible_value, .aggregate in which case we could // end up here and the values are equal if the type has zero fields. - return ty.structFieldCount() != 0; + return ty.isTupleOrAnonStruct() and ty.structFieldCount() != 0; }, .Float => { const a_nan = a.isNan();