From 28986a059075c2dce662c2f4e823b3efd283df87 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Fri, 17 Jun 2022 18:53:40 +0300 Subject: [PATCH] stage2: check that struct is a tuple when value tags differ in eql --- lib/std/bit_set.zig | 4 ---- src/value.zig | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/std/bit_set.zig b/lib/std/bit_set.zig index 9b0079ec74..8006a623b5 100644 --- 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 index 996aa76bf5..2239bb7b0e 100644 --- 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();