about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2025-06-13 09:49:48 +0000
committerChris Denton <chris@chrisdenton.dev>2025-06-13 09:49:48 +0000
commit595e88ae7d3cca6b05b1dfb4c3cd3ed74a1a7861 (patch)
tree8d16aa056e6b7da188a769132c576b325cd90ee3 /library/std/src
parent015c7770ec0ffdba9ff03f1861144a827497f8ca (diff)
downloadrust-595e88ae7d3cca6b05b1dfb4c3cd3ed74a1a7861.tar.gz
rust-595e88ae7d3cca6b05b1dfb4c3cd3ed74a1a7861.zip
Windows: make read_dir stop iterating on error
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sys/fs/windows.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/std/src/sys/fs/windows.rs b/library/std/src/sys/fs/windows.rs
index a95709b4891..9b674a25165 100644
--- a/library/std/src/sys/fs/windows.rs
+++ b/library/std/src/sys/fs/windows.rs
@@ -132,6 +132,7 @@ impl Iterator for ReadDir {
             let mut wfd = mem::zeroed();
             loop {
                 if c::FindNextFileW(handle.0, &mut wfd) == 0 {
+                    self.handle = None;
                     match api::get_last_error() {
                         WinError::NO_MORE_FILES => return None,
                         WinError { code } => {