authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-06-17 18:53:40+03:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-06-17 21:04:21+03:00
log28986a059075c2dce662c2f4e823b3efd283df87
treebeb90acdae662560c0c3a419858fd29fae362900
parenta224dfceee07a94d961506122a434563129428a5

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


2 files changed, 1 insertions(+), 5 deletions(-)

lib/std/bit_set.zig-4
...@@ -1330,7 +1330,6 @@ fn testStaticBitSet(comptime Set: type) !void {...@@ -1330,7 +1330,6 @@ fn testStaticBitSet(comptime Set: type) !void {
1330}1330}
13311331
1332test "IntegerBitSet" {1332test "IntegerBitSet" {
1333 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
1334 try testStaticBitSet(IntegerBitSet(0));1333 try testStaticBitSet(IntegerBitSet(0));
1335 try testStaticBitSet(IntegerBitSet(1));1334 try testStaticBitSet(IntegerBitSet(1));
1336 try testStaticBitSet(IntegerBitSet(2));1335 try testStaticBitSet(IntegerBitSet(2));
...@@ -1342,7 +1341,6 @@ test "IntegerBitSet" {...@@ -1342,7 +1341,6 @@ test "IntegerBitSet" {
1342}1341}
13431342
1344test "ArrayBitSet" {1343test "ArrayBitSet" {
1345 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
1346 if (@import("builtin").cpu.arch == .aarch64) {1344 if (@import("builtin").cpu.arch == .aarch64) {
1347 // https://github.com/ziglang/zig/issues/98791345 // https://github.com/ziglang/zig/issues/9879
1348 return error.SkipZigTest;1346 return error.SkipZigTest;
...@@ -1357,7 +1355,6 @@ test "ArrayBitSet" {...@@ -1357,7 +1355,6 @@ test "ArrayBitSet" {
1357}1355}
13581356
1359test "DynamicBitSetUnmanaged" {1357test "DynamicBitSetUnmanaged" {
1360 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
1361 const allocator = std.testing.allocator;1358 const allocator = std.testing.allocator;
1362 var a = try DynamicBitSetUnmanaged.initEmpty(allocator, 300);1359 var a = try DynamicBitSetUnmanaged.initEmpty(allocator, 300);
1363 try testing.expectEqual(@as(usize, 0), a.count());1360 try testing.expectEqual(@as(usize, 0), a.count());
...@@ -1398,7 +1395,6 @@ test "DynamicBitSetUnmanaged" {...@@ -1398,7 +1395,6 @@ test "DynamicBitSetUnmanaged" {
1398}1395}
13991396
1400test "DynamicBitSet" {1397test "DynamicBitSet" {
1401 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
1402 const allocator = std.testing.allocator;1398 const allocator = std.testing.allocator;
1403 var a = try DynamicBitSet.initEmpty(allocator, 300);1399 var a = try DynamicBitSet.initEmpty(allocator, 300);
1404 try testing.expectEqual(@as(usize, 0), a.count());1400 try testing.expectEqual(@as(usize, 0), a.count());
src/value.zig+1-1
...@@ -2186,7 +2186,7 @@ pub const Value = extern union {...@@ -2186,7 +2186,7 @@ pub const Value = extern union {
2186 // A tuple can be represented with .empty_struct_value,2186 // A tuple can be represented with .empty_struct_value,
2187 // the_one_possible_value, .aggregate in which case we could2187 // the_one_possible_value, .aggregate in which case we could
2188 // end up here and the values are equal if the type has zero fields.2188 // end up here and the values are equal if the type has zero fields.
2189 return ty.structFieldCount() != 0;2189 return ty.isTupleOrAnonStruct() and ty.structFieldCount() != 0;
2190 },2190 },
2191 .Float => {2191 .Float => {
2192 const a_nan = a.isNan();2192 const a_nan = a.isNan();