authorgravatar for 4678790+dweiller@users.noreply.github.comDominic <4678790+dweiller@users.noreply.github.com> 2025-01-28 22:55:02+11:00
committergravatar for 4678790+dweiller@users.noreply.github.comDominic <4678790+dweiller@users.noreply.github.com> 2025-04-26 13:34:17+10:00
log2e9c1553ef40e9f21c2241294b8942369ef9007a
tree22d15fcbe3982914e1607fb14a7e4cb775f3bf7b
parent5cba7c8562a5646996ee022b249d829b68fb6870

std: deprecate std.mem.copy{Forwards,Backwards}


1 files changed, 2 insertions(+), 0 deletions(-)

lib/std/mem.zig+2
......@@ -232,6 +232,7 @@ test "Allocator alloc and remap with zero-bit type" {
232232/// Copy all of source into dest at position 0.
233233/// dest.len must be >= source.len.
234234/// If the slices overlap, dest.ptr must be <= src.ptr.
235/// This function is deprecated; use @memmove instead.
235236pub fn copyForwards(comptime T: type, dest: []T, source: []const T) void {
236237 for (dest[0..source.len], source) |*d, s| d.* = s;
237238}
......@@ -239,6 +240,7 @@ pub fn copyForwards(comptime T: type, dest: []T, source: []const T) void {
239240/// Copy all of source into dest at position 0.
240241/// dest.len must be >= source.len.
241242/// If the slices overlap, dest.ptr must be >= src.ptr.
243/// This function is deprecated; use @memmove instead.
242244pub fn copyBackwards(comptime T: type, dest: []T, source: []const T) void {
243245 // TODO instead of manually doing this check for the whole array
244246 // and turning off runtime safety, the compiler should detect loops like