mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
std.mem.zeroes work with allowzero pointers
This commit is contained in:
parent
0b1e8690da
commit
d7c6cfa7fd
@ -276,7 +276,8 @@ pub fn zeroes(comptime T: type) T {
|
||||
return null;
|
||||
},
|
||||
.One, .Many => {
|
||||
@compileError("Can't set a non nullable pointer to zero.");
|
||||
if (ptr_info.is_allowzero) return @ptrFromInt(0);
|
||||
@compileError("Only nullable and allowzero pointers can be set to zero.");
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user