From 72017d4bd5f69eb243053a76227753b69bdf6b56 Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Sat, 13 Sep 2025 19:32:52 -0700 Subject: [PATCH] mem.replace: Document that input/output cannot overlap --- lib/std/mem.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/std/mem.zig b/lib/std/mem.zig index f688bafcae..0b0967a566 100644 --- a/lib/std/mem.zig +++ b/lib/std/mem.zig @@ -3785,6 +3785,7 @@ test rotate { /// Replace needle with replacement as many times as possible, writing to an output buffer which is assumed to be of /// appropriate size. Use replacementSize to calculate an appropriate buffer size. +/// The `input` and `output` slices must not overlap. /// The needle must not be empty. /// Returns the number of replacements made. pub fn replace(comptime T: type, input: []const T, needle: []const T, replacement: []const T, output: []T) usize {