| author | |
| committer | |
| log | d7c6cfa7fdf51f0b52aa3666aaa3022bd8e4876f |
| tree | f6d74813a9f5f16ff0264ce5e17c4366cbdb8a53 |
| parent | 0b1e8690dadb5d81b4d63832e27a117f57b4be81 |
1 files changed, 2 insertions(+), 1 deletions(-)
lib/std/mem.zig+2-1| ... | @@ -276,7 +276,8 @@ pub fn zeroes(comptime T: type) T { | ... | @@ -276,7 +276,8 @@ pub fn zeroes(comptime T: type) T { |
| 276 | return null; | 276 | return null; |
| 277 | }, | 277 | }, |
| 278 | .One, .Many => { | 278 | .One, .Many => { |
| 279 | @compileError("Can't set a non nullable pointer to zero."); | 279 | if (ptr_info.is_allowzero) return @ptrFromInt(0); |
| 280 | @compileError("Only nullable and allowzero pointers can be set to zero."); | ||
| 280 | }, | 281 | }, |
| 281 | } | 282 | } |
| 282 | }, | 283 | }, |