Skip to content

Rollup of 7 pull requests - #160158

Closed
JonathanBrouwer wants to merge 20 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-VaeEIu2
Closed

Rollup of 7 pull requests#160158
JonathanBrouwer wants to merge 20 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-VaeEIu2

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

mkroening and others added 20 commits July 1, 2026 11:18
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
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jul 29, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 29, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-*

@rust-bors

rust-bors Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ece20ed has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 29, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 29, 2026
@rust-bors

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-*
@jhpratt jhpratt closed this Jul 29, 2026
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 29, 2026
@rust-bors

rust-bors Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@rust-bors

rust-bors Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f619144 (f6191445eda96772d0fbef93ecfd277d6d7383cf)
Base parent: d366396 (d3663963ca08f465d01d283a7199778902623bb9)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants