I've been programming in rust for three years, until I picked up zig recently. I was also worried about memory safety when I started using it, but I've been pleasantly surprised how many safety features it has (it's certainly been easier to debug than the C code I've had to work with). Slices are often mentioned for safety, which they are great, but even better has been all of the casting functions. In Debug and ReleaseSafe mode, @intCast will panic if you try to narrow on integer that's too big. @alignCast checks that the alignment is correct. @bitCast ensures that both types have the same bit width. Non-packed unions will panic if you access the wrong field. Integer under and overflow has revealed some of my bad code like four times now. defer/errdefer is much easier to reason about that "goto cleanup" (it also lets me write custom cleanup code, instead of being beholden to the author's drop implementation).
So no, it's not as safe as rust in terms of memory, but it's quite close, and in the process lets you do some really cool stuff.
So no, it's not as safe as rust in terms of memory, but it's quite close, and in the process lets you do some really cool stuff.