zig
zig copied to clipboard
Handle sentinel slices in `std.mem.zeroes`. Fixes #13256
Adding an error message seems to be the only reasonable way to handle this. Otherwise we'd need to have a memory region that contains the sentinel value.
However I took the freedom of adding a special case for null-terminated string literals [:0] const u8.
These are the most common use-case for sentinel slices, so I think it makes sense to handle these seperately.
This also makes the use case #13256 work.