Skip to content

Rollup of 18 pull requests - #160174

Closed
jhpratt wants to merge 55 commits into
rust-lang:mainfrom
jhpratt:rollup-2pBeTwD
Closed

Rollup of 18 pull requests#160174
jhpratt wants to merge 55 commits into
rust-lang:mainfrom
jhpratt:rollup-2pBeTwD

Conversation

@jhpratt

@jhpratt jhpratt commented Jul 29, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

mkroening and others added 30 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.
Co-authored-by: Clar Fon <15850505+clarfonthey@users.noreply.github.com>
fix: give reason before the issue number
…span

`missing_items_err` has logic to figure out where in the impl to insert
suggestions. Factor that logic out into a function to support reusing
it.
`missing_items_err` has logic to compute a set of suggestions regarding
the missing items. Factor that logic out into a function to support
reusing it.
As with the suggestions for mandatory trait methods, provide suggestions
for `must_implement_one_of`, which include the signatures of the trait
methods. This makes it easy to copy-paste the signatures into the impl
block.

Invoke the same logic from `check_drop_xor_pin_drop`, to provide
suggestions with the signatures of `drop` and `pin_drop`.

Without this change:
```
error[E0046]: not all trait items implemented, missing one of: `read`, `read_buf`
 --> src/main.rs:3:1
  |
3 | impl std::io::Read for R {
  | ^^^^^^^^^^^^^^^^^^^^^^^^ missing one of `read`, `read_buf` in implementation

For more information about this error, try `rustc --explain E0046`.
```

With this change:
```
error[E0046]: not all trait items implemented, missing one of: `read`, `read_buf`
 --> src/main.rs:3:1
  |
3 | impl std::io::Read for R {
  | ^^^^^^^^^^^^^^^^^^^^^^^^ missing one of `read`, `read_buf` in implementation
  |
  = help: implement the missing item: `fn read(&mut self, _: &mut [u8]) -> Result<usize, std::io::Error> { todo!() }`
  = help: implement the missing item: `fn read_buf(&mut self, _: BorrowedCursor<'_, u8>) -> Result<(), std::io::Error> { todo!() }`

For more information about this error, try `rustc --explain E0046`.
```
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
Deeply nested associated-type projections used to ICE with "type variables
should not be hashed" under incremental compilation; they now produce ordinary
trait-bound errors. Uses `//@ incremental` so the crash path is exercised.
rust-lang#158547 moved `std::io::BufWriter` to
`alloc::io::BufWriter`. That allows it to be used in `no-std` configurations,
and in particular on platforms where unwinding isn't supported.

However one of the doc tests uses `catch_unwind`, which fails on platforms
which cannot unwind. Fix this by copying the magic incantation from a similar
doctest in library/core/src/range.rs
jhpratt added 6 commits July 29, 2026 13:52
…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.
…on, r=joboet

iter: specialize Take::count using advance_by

Right now, when you call .count() on a Take iterator, it visits every single item one by one just to count them. That's slow.

For example, if you have 1000 items and call .take(5).count(), it should just skip 5 items and return 5 — but today it actually goes through each item manually.

This PR fixes that by using advance_by to skip items in bulk instead of visiting each one. After the skip, we know exactly how many items were consumed, so we return that number directly.

This makes .count() faster for Take iterators, especially when the underlying iterator supports fast skipping.
…, 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
… r=clarfonthey

Mark a doctest as requiring unwinding

rust-lang#158547 moved `std::io::BufWriter` to `alloc::io::BufWriter`. That allows it to be used in `no-std` configurations, and in particular on platforms where unwinding isn't supported.

However one of the doc tests uses `catch_unwind`, which fails on platforms which cannot unwind. Fix this by copying the magic incantation from a similar doctest in library/core/src/range.rs
…es, r=tgross35

Use correct feature gates for `f16`/`f128` `From` impls

This PR updates the `f16`/`f128` `From` impls in `core` to be annotated with the correct feature gates, instead of the feature gate that was used to stabilise the impls for `f32` and `f64`. The impls are already inaccessible on stable as it is impossible to use them without explicitly naming `f16`/`f128`, so this is just to improve the documentation of what things are stable.

r? @tgross35

Tracking issue: rust-lang#116909
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jul 29, 2026
@rustbot rustbot added A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc 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-infra Relevant to the infrastructure 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
@jhpratt

jhpratt commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9790598 has been approved by jhpratt

It is now in the queue for this repository.

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

rust-bors Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit 9790598 with merge a981d4b...

Workflow: https://github.com/rust-lang/rust/actions/runs/30477390929

rust-bors Bot pushed a commit that referenced this pull request Jul 29, 2026
Rollup of 18 pull requests

Successful merges:

 - #159130 (a bit optimize four-digit chunks in integer formatting)
 - #159592 (core: implement bounded random sampling)
 - #159898 (Add intrinsic-test alias and set  sample rate)
 - #158247 (hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)`)
 - #158649 (Hermit: fix `readdir()` )
 - #159049 (Avoid ICE in From/TryFrom cast suggestion when encountering HRTBs)
 - #160053 (test: add test suite for the 85681 issue)
 - #160087 (Add regression test for nested associated-type projection ICE)
 - #160090 (rustc_resolve: Further reduce mutability in resolver)
 - #160099 (Resolver: split module resolutions into local and external resolutions)
 - #160106 (Add suggestions for `must_implement_one_of`)
 - #160117 (Remove unnecessary format usage)
 - #160134 (Work around Wine bug 60084 by calling WSAStartup at most once)
 - #160139 (iter: specialize Take::count using advance_by)
 - #160142 (bootstrap: remove use-lld config alias)
 - #160148 (Rename `errors.rs` file to `diagnostics.rs` (15/N))
 - #160151 (Mark a doctest as requiring unwinding)
 - #160166 (Use correct feature gates for `f16`/`f128` `From` impls)
@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

PR #159130, which is a member of this rollup, was unapproved.

This rollup was thus unapproved.

Auto build was cancelled due to unapproval. Cancelled workflows:

@rust-bors

rust-bors Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

PR #159130, which is a member of this rollup, changed its commit SHA.

This rollup was closed.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 29, 2026
@jhpratt
jhpratt deleted the rollup-2pBeTwD branch July 29, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows rollup A PR which is a rollup 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-infra Relevant to the infrastructure 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.