diff --git a/lib/std/mem.zig b/lib/std/mem.zig index 65d801a0aa65d5bdc2c8176f9e6f5054750582a9..039b9d43249146ffd424cd1b29e6c19c38985a20 100644 --- a/lib/std/mem.zig +++ b/lib/std/mem.zig @@ -3965,7 +3965,9 @@ fn CopyPtrAttrs( } fn AsBytesReturnType(comptime P: type) type { - const size = @sizeOf(std.meta.Child(P)); + const pointer = @typeInfo(P).pointer; + assert(pointer.size == .One); + const size = @sizeOf(pointer.child); return CopyPtrAttrs(P, .One, [size]u8); }