mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 01:04:43 +01:00
tests: unions without fields need not store their tag at runtime
...because the union semantically has no possible value so cannot be stored to or loaded from memory anyway.
This commit is contained in:
parent
d1d377a80c
commit
2b32c2748e
1 changed files with 1 additions and 5 deletions
|
|
@ -1020,7 +1020,7 @@ test "containers with single-field enums" {
|
|||
try comptime S.doTheTest();
|
||||
}
|
||||
|
||||
test "@unionInit on union with tag but no fields" {
|
||||
test "@unionInit on union with u8 tag but no fields" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
|
||||
|
|
@ -1036,10 +1036,6 @@ test "@unionInit on union with tag but no fields" {
|
|||
}
|
||||
};
|
||||
|
||||
comptime {
|
||||
assert(@sizeOf(Data) == 1);
|
||||
}
|
||||
|
||||
fn doTheTest() !void {
|
||||
var data: Data = .{ .no_op = {} };
|
||||
_ = &data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue