Depends what you mean by "true".
Is that specific zig function easier to use correctly than a rust function that explicitly says it's "incredibly unsafe" in its documentation, as well as specifically says not to use it for "Turning an
&mut T into an
&mut U" as the blog post does? Yes.
Does that really matter to me? No, because in Rust I'm almost always in safe code where I don't even need to think about it. And Rust safe code is always safe, not just safe in one of the three release profiles.
And of course Rust has its own helpful functions for dealing with alignment, like
[T]::align_to -- which is unsafe because it allows reinterpreting the data as something different, which can be unsound. Conspicuously, the article doesn't say what would happen in Zig if you tried to do that same thing between, say, an array of doubles and a
String -- the documentation doesn't mention it either, so I assume it's just checking alignment and that would (at best) blow up horribly when you use it.
And we're close to safe rust being able to handle these situations, which will clearly be safer than unsafe Rust and unsafe Zig.
TL/DR: The post has a clickbait title and attacks a strawman. I'd ignore it because of that, even though Zig's alignment-parameterized pointers are a nice feature.