about summary refs log tree commit diff
path: root/tests/rustdoc-ui/coverage/enum-tuple.rs
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-12-10 08:55:55 +0100
committerGitHub <noreply@github.com>2024-12-10 08:55:55 +0100
commit783362ddf9b501aeecabab812be71ce65aa3a9b1 (patch)
tree9b26a0ae7f316bc01d82b129dd485ead8f94a019 /tests/rustdoc-ui/coverage/enum-tuple.rs
parent94d780d64721470cd8485743ce6702100dcf3e2f (diff)
parentf4ab9829e1a3c6e564f79c98f39632aecbc675d3 (diff)
downloadrust-783362ddf9b501aeecabab812be71ce65aa3a9b1.tar.gz
rust-783362ddf9b501aeecabab812be71ce65aa3a9b1.zip
Rollup merge of #133184 - osiewicz:wasm-fix-infinite-loop-in-remove-dir-all, r=Noratrieb
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. The tests do pass when everything but the extensions is compiled with 1.82.

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