authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-12-14 19:05:57+01:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-12-14 20:06:46+01:00
log9e5869262a5f07300b7f4ff65dfe60810f22afee
tree14006ca3335e85402b9492a32e3f9d5247978337
parent44556bfebe8d06133c4dfc3cc2685ecb9d3babcd

std: Bool has no definite representation too

The padding bits are undefined.

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

lib/std/meta/trait.zig+2-1
......@@ -476,7 +476,6 @@ pub fn hasUniqueRepresentation(comptime T: type) bool {
476476 else => return false, // TODO can we know if it's true for some of these types ?
477477
478478 .AnyFrame,
479 .Bool,
480479 .BoundFn,
481480 .Enum,
482481 .ErrorSet,
......@@ -484,6 +483,8 @@ pub fn hasUniqueRepresentation(comptime T: type) bool {
484483 .Pointer,
485484 => return true,
486485
486 .Bool => return false,
487
487488 // The padding bits are undefined.
488489 .Int => |info| return (info.bits % 8) == 0 and
489490 (info.bits == 0 or std.math.isPowerOfTwo(info.bits)),