Zig Version
zig-0.15.0.1184+c41ac8f19
Steps to Reproduce and Observed Behavior
main.zig:
const std = @import("std");
const shader_code: *const [4:0]u8 = @embedFile("test.txt");
pub fn main() void {
std.debug.print("{d}\n", .{shader_code.len});
createShader(@alignCast(shader_code));
}
fn createShader(data: [:0]align(4) const u8) void {
std.debug.print("{d}\n", .{data.len});
}
(note, that createShader() takes a non-terminated slice)
(EDIT: doesn't matter)
test.txt (no trailing line break):
Expected Behavior
Even after @alignCast, the slice's length should be 4.
This was the case in zig 0.14.
Zig Version
zig-0.15.0.1184+c41ac8f19
Steps to Reproduce and Observed Behavior
main.zig:
(note, thatcreateShader()takes a non-terminated slice)(EDIT: doesn't matter)
test.txt (no trailing line break):
Expected Behavior
Even after
@alignCast, the slice's length should be4.This was the case in zig 0.14.