Commit 28986a0590

Veikka Tuominen <git@vexu.eu>
2022-06-17 17:53:40
stage2: check that struct is a tuple when value tags differ in eql
1 parent a224dfc
Changed files (2)
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());
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();