Zig Version
0.12.0
Steps to Reproduce and Observed Behavior
const std = @import("std");
const builtin = @import("builtin");
test {
const a: u32 = 0xCE94C13E;
const b: *const u32 = &a;
const c: []const u32 = b[0..1];
const d: []const u8 = @ptrCast(c);
comptime std.debug.assert(builtin.target.cpu.arch.endian() == .little);
try std.testing.expect(std.mem.eql(u8, d, &.{ 0x3E, 0xC1, 0x94, 0xCE }));
}
test.zig:8:27: error: TODO: implement @ptrCast between slices changing the length
const d: []const u8 = @ptrCast(c);
^~~~~~~~~~~
Expected Behavior
all 1 tests passed.
have known about this error for quite some time but ran into it again just now and noticed there was no explicit tracking issue for it
Zig Version
0.12.0
Steps to Reproduce and Observed Behavior
Expected Behavior
all 1 tests passed.
have known about this error for quite some time but ran into it again just now and noticed there was no explicit tracking issue for it