Skip to content

Commit

Permalink
std: Bool has no definite representation too
Browse files Browse the repository at this point in the history
The padding bits are undefined.
  • Loading branch information
LemonBoy committed Dec 14, 2020
1 parent 9bed868 commit 6a54cb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/std/meta/trait.zig
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,15 @@ 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,
.Fn,
.Pointer,
=> return true,

.Bool => return false,

// The padding bits are undefined.
.Int => |info| return (info.bits % 8) == 0,

Expand Down

0 comments on commit 6a54cb3

Please sign in to comment.