commit 03e2c53747a7eeb0d162f7b7fa7763fffdeba2d8 (tree) parent 31ba9d569b14a3e147d9bdfe88d63a1ed134bc5f Author: daurnimator <quae@daurnimator.com> Date: Sat, 2 Jan 2021 01:10:47 +1100 Add workaround in PackedIntArray .initAllTo for #7635 Diffstat:
| M | lib/std/packed_int_array.zig | | | 3 | ++- |
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/std/packed_int_array.zig b/lib/std/packed_int_array.zig @@ -205,7 +205,8 @@ pub fn PackedIntArrayEndian(comptime Int: type, comptime endian: builtin.Endian, ///Initialize all entries of a packed array to the same value pub fn initAllTo(int: Int) Self { - var self = @as(Self, undefined); + // TODO: use `var self = @as(Self, undefined);` https://github.com/ziglang/zig/issues/7635 + var self = Self{ .bytes = [_]u8{0} ** total_bytes }; self.setAll(int); return self; }