Rollup of 5 pull requests - #161134
Open
JonathanBrouwer wants to merge 10 commits into
Open
Conversation
* Update expect messages for library/alloc/src/vec/mod.rs * Update expect messages for library/alloctests/tests/vec.rs * Update expect messages for library/alloc/src/vec/mod.rs and library/alloctests/tests/vec.rs * Revert "Update expect messages for library/alloc/src/vec/mod.rs and library/alloctests/tests/vec.rs" This reverts commit 009fa6f.
`Iterator::{min,max}(_by_key)` should use overridden `min`/`max`/`lt`
Two related changes to provided Iterator implementations:
- `Iterator::min` and `Iterator::max` are currently implemented via `min_by` and `max_by`, which means they don't use `Ord::{min,max}` despite those being overridable to do something more efficient. Move these to just being `.reduce(Ord::min)` and `.reduce(Ord::max)` to take advantage of potential overrides.
- `Iterator::min_by_key` and `Iterator::max_by_key` are implemented by mapping to a tuple then using `min_by`/`max_by` with a comparator that only looks at one field in the tuple. That means they end up doing things like `a.cmp(b).is_le()`, which is wasteful if there an overloaded `-> bool` method it could use instead. So rephrase these two to work as `.map(…).min()`/`.map(…).max()` by mapping to a type that's *not* a tuple and which can thus override more things instead of just passing a `Fn(…) -> Ordering`.
Update expect messages for library/alloc/src/vec/mod.rs Related issue: rust-lang#159751 Updated some expect messages for `library/alloc/src/vec/mod.rs`
…itor Improve OpenOptions append+truncate error message Fixes rust-lang#160716. When `OpenOptions` is configured with both `append(true)` and `truncate(true)`, the previous `InvalidInput` error message was: > creating or truncating a file requires write or append access This message is misleading because `append(true)` already provides append access. This change replaces it with a more descriptive error message indicating that `append` and `truncate` cannot both be enabled at the same time. The corresponding platform-specific tests have been updated to verify the new error message and ensure consistent behavior across the relevant implementations.
…JohnTitor Forward all array `PartialOrd` to slices I happened to notice that these have had too many `&`s since before 1.0 -- it ends up using `&[T]: PartialOrd` and thus wastefully need to forward to `[T]: PartialOrd`. So re-written to specify the implementation to which we're trying to delegate explicitly (by writing `<[T] as PartialOrd>`) which means we no longer need the `&&self[..]`-style dance at all since the unsizing coercion will do the right thing. And while I was here delegating stuff, it also delegates the `__chaining_*` methods, since those have custom overrides for slices (rust-lang#138881) and we ought to take advantage of that for arrays too.
…ough, r=jieyouxu Explicitly pass run_make_support rlib/rmeta paths to compiletest This should unblock rust-lang#151061, and helps with rust-lang/cargo#17359 from the side of run-make-support. I tested this with `-Zembed-metadata=no` applied to everything (in `Builder::cargo`), it works now both with and without it (that's not to say that applying `-Zembed-metadata=no` won't break something else, ofc). CC @bjorn3 r? jieyouxu --- try-job: aarch64-apple-1 try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: aarch64-msvc-1 try-job: x86_64-mingw-1 try-job: armhf-gnu
Contributor
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 15, 2026
Rollup of 5 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-1 try-job: aarch64-apple-2 try-job: x86_64-mingw-1 try-job: i686-msvc-1 try-job: i686-msvc-2
Contributor
Contributor
|
⌛ Testing commit 463a8c9 with merge c9b7f17... Workflow: https://github.com/rust-lang/rust/actions/runs/31896930936 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 15, 2026
…uwer Rollup of 5 pull requests Successful merges: - #160203 (`Iterator::{min,max}(_by_key)` should use overridden `min`/`max`/`lt`) - #159862 (Update expect messages for library/alloc/src/vec/mod.rs) - #160719 (Improve OpenOptions append+truncate error message) - #160996 (Forward all array `PartialOrd` to slices) - #161102 (Explicitly pass run_make_support rlib/rmeta paths to compiletest)
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:
Iterator::{min,max}(_by_key)should use overriddenmin/max/lt#160203 (Iterator::{min,max}(_by_key)should use overriddenmin/max/lt)PartialOrdto slices #160996 (Forward all arrayPartialOrdto slices)r? @ghost
Create a similar rollup