Rollup of 7 pull requests - #160158
Closed
JonathanBrouwer wants to merge 20 commits into
Closed
Conversation
This is also how it is done on other platforms.
This optimization was already partially in place, but not used. Other platforms already do this.
Previously, we read all entries into a huge initialized buffer up front, which does not work correctly since on Hermit 0.12, getdents64 behaves more reasonable and does no longer fail on buffers which cannot hold all entries. Additionally, for each new entry, we started searching for the current position from the start instead of just saving the position directly. The new design uses a fixed-size uninitialized buffer that is read into as necessary. Co-authored-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
While Hermit does not return these yet, it will do so in the future.
CC [Wine bug 60084](https://bugs.winehq.org/show_bug.cgi?id=60084) CC tokio-rs/mio#1980 Wine's `WSAStartup`/`WSACleanup` are currently not thread-safe (though they probably should be, which is why I reported an upstream bug). Before rust-lang#141809 (and Rust 1.90), Rust used to call `WSAStartup` at most once. This PR restores that behavior. I believe that this is not a regression for real Windows, since the hot path of a `Once` already having executed is well-optimized, it's just one atomic load, like before.
… having a `OnceLock` around it for parallel import resolution
…=clarfonthey hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)` Currently, Hermit uses a mix of `Err(Error::from_raw_os_error(22))` (`EINVAL`) and `unsupported()` for unsupported operations. This PR makes Hermit consistently use `unsupported()` everywhere. This should address rust-lang#158168 (comment) and rust-lang#158168 (comment). r? clarfonthey CC: @stlankes
Hermit: fix `readdir()` On Hermit, the `sys_getdents` implementation was flawed, as it wasn't stateful. So the caller had to provide a buffer large enough to hold all `dirents` of the directory in question. Else it returns `EINVAL`. The current workaround used in Rust is to grow the buffer until it is sufficiently large. hermit-os/kernel#1738 fixes the behavior of `sys_getdents`. Hermit now keeps track of the directory position, and each new call to the `sys_getdents` provides the next entries. But this results in the current implementation in Rust Std being flawed: Because Hermit now returns a proper _readcount_, `read_dir` will only ever iterate over the first 512 bytes of directory entries, even if not all `dirent64`s are read. This PR fixes this with a proper implementation of the `getdents64` algorithm. Remark: This breaks compatibility with Hermit versions 0.11 and previous. We have discussed this in the Hermit team and have come to the conclusion that this is ok. We have released two newer "major" versions since, and Hermit is still in the development phase where we don't guarantee any stability and backwards compatibility in the kernel itself.
Avoid ICE in From/TryFrom cast suggestion when encountering HRTBs When the cast suggestion sees a `where for<'a> Foo: From<&'a String>` pred where `Foo` doesn't `impl From<&'a String>`, it calls `skip_binder()` on the main and leaf preds, giving us a type like `&'a String`. When we try to look for impls of `From<<&'a String as Deref>::Target>` for the suggestion, we see the escaping `'a` and ICE. This PR changes the `skip_binder()`s to `no_bound_vars()`. As a consequence, we skip creating the help line when the `From`/`TryFrom` bound is higher-ranked. fixes rust-lang#158967
…lutions, r=petrochenkov Resolver: split module resolutions into local and external resolutions Part of rust-lang#158845. This pr splits the resolution table for local and external modules, with the external table being wrapped in a `OnceLock`, because only 1 thread may create that table in parallel resolution. r? @petrochenkov
…hrisDenton Work around Wine bug 60084 by calling WSAStartup at most once CC [Wine bug 60084](https://bugs.winehq.org/show_bug.cgi?id=60084) CC tokio-rs/mio#1980 Wine's `WSAStartup`/`WSACleanup` are currently not thread-safe (though they probably should be, which is why I reported an upstream bug). Before rust-lang#141809 (and Rust 1.90), Rust used to call `WSAStartup` at most once. This PR restores that behavior. I believe that this is not a regression for real Windows, since the hot path of a `Once` already having executed is well-optimized, it's just one atomic load, like before.
…, r=Kobzol bootstrap: remove use-lld config alias This removes the deprecated rust.use-lld configuration alias. rust.bootstrap-override-lld has replaced this option, and the compatibility period has ended. The old alias is no longer parsed or merged with the new setting, and its legacy compatibility tests are removed. A regression test now verifies that rust.use-lld is rejected as an unknown configuration option.
…nathanBrouwer Rename `errors.rs` file to `diagnostics.rs` (15/N) Follow-up of rust-lang#157485. r? @JonathanBrouwer
Contributor
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 29, 2026
Rollup of 7 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-*
Contributor
|
This pull request was unapproved due to being closed. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
unsupported()instead offrom_raw_os_error(22)#158247 (hermit/fs: Returnunsupported()instead offrom_raw_os_error(22))readdir()#158649 (Hermit: fixreaddir())errors.rsfile todiagnostics.rs(15/N) #160148 (Renameerrors.rsfile todiagnostics.rs(15/N))r? @ghost
Create a similar rollup