Get the latest tech news
Zig's Memcpy, CopyForwards and CopyBackwards
Why we have 3 similar function and how aliasing impacts the compiler
More generally, aliasing means that compilers need to handle the possibility that writing to a pointer affects other variables. Still, unless you're copying into newly allocated memory, it's probably worth spending a few seconds to consider whether the source and destination could overlap and, if so, whether std.mem.copyForwards(or, less likely in my experience std.mem.copyBackwars) is the correct choice. Some guidelines use the word "avoid", but I've settled on merely being more mindful of it (at least for now); maybe now and again I manage to limit the scope where two variables reference the same memory.
Or read this on Hacker News