about summary refs log tree commit diff
path: root/tests/rustdoc-ui/coverage/enum-tuple.rs
diff options
context:
space:
mode:
authorPiotr Osiewicz <24362066+osiewicz@users.noreply.github.com>2024-11-18 18:58:56 +0100
committerPiotr Osiewicz <24362066+osiewicz@users.noreply.github.com>2024-11-18 19:19:14 +0100
commit529aae6fc368818bf64d21aab217826a6c0745fc (patch)
tree02cb65393f093415b3c24c969bcccf04f1c27aae /tests/rustdoc-ui/coverage/enum-tuple.rs
parente83c45a98bf8c8228fb60e55a1cb75b8e69b5c1b (diff)
downloadrust-529aae6fc368818bf64d21aab217826a6c0745fc.tar.gz
rust-529aae6fc368818bf64d21aab217826a6c0745fc.zip
wasi/fs: Improve stopping condition for <ReadDir as Iterator>::next
When upgrading [Zed](https://github.com/zed-industries/zed/pull/19349) to Rust 1.82 I've encountered a test failure in our test suite. Specifically, one of our extension tests started hanging. I've tracked it down to a call to std::fs::remove_dir_all not returning when an extension is compiled with Rust 1.82
Our extension system uses WASM components, thus I've looked at the diff between 1.81 and 1.82 with respect to WASI and found 736f773844e7ebf05ccb827c17b7ad9eb28aa295

As it turned out, calling remove_dir_all from extension returned io::ErrorKind::NotFound in 1.81;
the underlying issue is that the ReadDir iterator never actually terminates iteration, however since it loops around, with 1.81 we'd come across an entry second time and fail to remove it, since it would've been removed previously.
With 1.82 and 736f773844e7ebf05ccb827c17b7ad9eb28aa295 it is no longer the case, thus we're seeing the hang.

This commit makes ReadDir::next adhere to readdir contract, namely it will no longer call readdir once the returned # of bytes is smaller than the size of a passed-in buffer.
Previously we'd only terminate the loop if readdir returned 0.
Diffstat (limited to 'tests/rustdoc-ui/coverage/enum-tuple.rs')
0 files changed, 0 insertions, 0 deletions