From 417c92895263250ca399bcf7a1a2abaee6067624 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Wed, 8 Jul 2020 00:03:45 +0200 Subject: [PATCH] Add comment about memory invalidation in Iterator.next on Win --- lib/std/fs.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/fs.zig b/lib/std/fs.zig index e932253bdb..f8777f28e4 100644 --- a/lib/std/fs.zig +++ b/lib/std/fs.zig @@ -453,6 +453,8 @@ pub const Dir = struct { pub const Error = IteratorError; + /// Memory such as file names referenced in this returned entry becomes invalid + /// with subsequent calls to `next`, as well as when this `Dir` is deinitialized. pub fn next(self: *Self) Error!?Entry { start_over: while (true) { const w = os.windows;