mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
std: Bool has no definite representation too
The padding bits are undefined.
This commit is contained in:
parent
44556bfebe
commit
9e5869262a
@ -476,7 +476,6 @@ pub fn hasUniqueRepresentation(comptime T: type) bool {
|
||||
else => return false, // TODO can we know if it's true for some of these types ?
|
||||
|
||||
.AnyFrame,
|
||||
.Bool,
|
||||
.BoundFn,
|
||||
.Enum,
|
||||
.ErrorSet,
|
||||
@ -484,6 +483,8 @@ pub fn hasUniqueRepresentation(comptime T: type) bool {
|
||||
.Pointer,
|
||||
=> return true,
|
||||
|
||||
.Bool => return false,
|
||||
|
||||
// The padding bits are undefined.
|
||||
.Int => |info| return (info.bits % 8) == 0 and
|
||||
(info.bits == 0 or std.math.isPowerOfTwo(info.bits)),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user