Make hasUniqueRepresentation false for slices
This commit is contained in:
@@ -480,7 +480,6 @@ pub fn hasUniqueRepresentation(comptime T: type) bool {
|
||||
.Enum,
|
||||
.ErrorSet,
|
||||
.Fn,
|
||||
.Pointer,
|
||||
=> return true,
|
||||
|
||||
.Bool => return false,
|
||||
@@ -489,6 +488,8 @@ pub fn hasUniqueRepresentation(comptime T: type) bool {
|
||||
.Int => |info| return (info.bits % 8) == 0 and
|
||||
(info.bits == 0 or std.math.isPowerOfTwo(info.bits)),
|
||||
|
||||
.Pointer => |info| return info.size != .Slice,
|
||||
|
||||
.Array => |info| return comptime hasUniqueRepresentation(info.child),
|
||||
|
||||
.Struct => |info| {
|
||||
|
||||
Reference in New Issue
Block a user