authorgravatar for jjhellst@gmail.comJanne Hellsten <jjhellst@gmail.com> 2026-09-26 13:55:39+03:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-27 01:38:23+02:00
log7126b2afd828171cb19945e00d5a6f15ea6cef4f
tree84f5b635c35089e1df8ed51506da11b8171e37b2
parent3cb5bbb36d09baf4f08464c1d047607a1f09a967

std.bit_set: bugfix Integer.setAll

Also changes the setAll test case to trigger the mask bug. The test fails without the mask fix.

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

lib/std/bit_set.zig+2-1
......@@ -170,7 +170,7 @@ pub fn Integer(comptime size: u16) type {
170170
171171 /// Set all bits to 1.
172172 pub fn setAll(self: *Self) void {
173 self.mask = ~self.mask;
173 self.mask = ~@as(MaskInt, 0);
174174 }
175175
176176 /// Performs a union of two bit sets, and stores the
......@@ -1671,6 +1671,7 @@ fn testBitSet(a: anytype, b: anytype, len: usize) !void {
16711671 a.unsetAll();
16721672 try testing.expectEqual(0, a.count());
16731673
1674 fillEven(a, len);
16741675 a.setAll();
16751676 try testing.expectEqual(len, a.count());
16761677}