We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent becebb3 commit d1bc9ceCopy full SHA for d1bc9ce
library/std/src/sys/pal/unix/fs.rs
@@ -870,12 +870,9 @@ impl Iterator for ReadDir {
870
871
impl Drop for Dir {
872
fn drop(&mut self) {
873
- let r = unsafe { libc::closedir(self.0) };
874
- assert!(
875
- r == 0 || crate::io::Error::last_os_error().is_interrupted(),
876
- "unexpected error during closedir: {:?}",
877
- crate::io::Error::last_os_error()
878
- );
+ // Note that errors are ignored when closing a directory as we have
+ // no non-destructive way to report it. See #124105 and #98338.
+ let _ = unsafe { libc::closedir(self.0) };
879
}
880
881
0 commit comments