mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 08:45:52 +00:00
Make hasUniqueRepresentation false for slices
This commit is contained in:
parent
1634d45f1d
commit
1df601d581
@ -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| {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user