~alva/zig-bare

d39721d00ac7ac98d75f79d6232cee7450c50bb5 — Alva 4 months ago e01f256
Don't zero structs

It causes compile errors with tagged union members.
1 files changed, 1 insertions(+), 1 deletions(-)

M src/bare.zig
M src/bare.zig => src/bare.zig +1 -1
@@ 100,7 100,7 @@ pub const Reader = struct {

    fn readStruct(self: *Self, comptime T: type, stream: var) !T {
        const ti = @typeInfo(T).Struct;
        var s = mem.zeroes(T);
        var s: T = undefined;

        if (ti.fields.len < 1)
            return @compileError("structs must have at least one field");