Rollup of 18 pull requests - #160174
Closed
jhpratt wants to merge 55 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.
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
…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
Member
Author
|
@bors r+ rollup=never p=5 |
Contributor
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)
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: |
Contributor
|
PR #159130, which is a member of this rollup, changed its commit SHA. This rollup was closed. |
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())must_implement_one_of#160106 (Add suggestions formust_implement_one_of)errors.rsfile todiagnostics.rs(15/N) #160148 (Renameerrors.rsfile todiagnostics.rs(15/N))f16/f128Fromimpls #160166 (Use correct feature gates forf16/f128Fromimpls)r? @ghost
Create a similar rollup