Skip to content

Conversation

@Zalathar
Copy link
Member

Successful merges:

r? @ghost

Create a similar rollup

jdonszelmann and others added 30 commits December 17, 2025 14:14
On FreeBSD 15, the error code returned in this situation changed.  It's
now ENETUNREACH.  I think that error code is reasonable, and it's
documented for connect(2), so we should expect that it might be
returned.
`cargotest` can only detect the worst offenders (like tests failing, or
hard compiler errors / ICEs), but regardless, bumping `diesel` to a way
more recent version hopefully contributes slightly towards helping us
not break `diesel` if at all possible.
std supports redirecting stdio file descriptors.
- Make flush a noop since it is only for buffered writers.
- Also forward fsync to datasync. UEFI does not have anything
  separate for metadata sync.

Signed-off-by: Ayush Singh <[email protected]>
Since yesterday, the LLVM `main` branch should have working `f16` on all
platforms that Rust supports; this will be LLVM version 22, so update
how `cfg(target_has_reliable_f16)` is set to reflect this.

Within the rust-lang organization, this currently has no effect. The
goal is to start catching problems as early as possible in external CI
that runs top-of-tree rust against top-of-tree LLVM, and once testing
for the rust-lang bump to LLVM 22 starts. Hopefully this will mean that
we can fix any problems that show up before the bump actually happens,
meaning `f16` will be about ready for stabilization at that point (with
some considerations for the GCC patch at [1] propagating).

References:

* llvm/llvm-project@919021b
* llvm/llvm-project@054ee2f
* llvm/llvm-project@db26ce5
* llvm/llvm-project@549d7c4
* llvm/llvm-project@4903c62

[1]: gcc-mirror/gcc@8b6a18e
- Tested using OVMF on QEMU.

Signed-off-by: Ayush Singh <[email protected]>
stabilize `Peekable::next_if_map` (`#![feature(peekable_next_if_map)]`)

# Stabilization report

## Summary

`#![feature(peekable_next_if_map)]` is a variation  of `next_if` on peekable iterators that can transform the peeked item. This creates a way to take ownership of the next item in an iterator when some condition holds, but put the item back when the condition doesn't hold. This pattern would otherwise have needed unwraps in many cases.

[Tracking issue](rust-lang#143702)

### What is stabilized

```rust
impl<I: Iterator> Peekable<I> {
    pub fn next_if_map<R>(
        &mut self,
        f: impl FnOnce(I::Item) -> Result<R, I::Item>,
    ) -> Option<R> {
        ..
    }
    pub fn next_if_map_mut<R>(
        &mut self,
        f: impl FnOnce(&mut I::Item) -> Option<R>,
    ) -> Option<R> {
        ..
    }
}
```

Example usage adapted from the ACP:

```rust
let mut it = Peekable::new("123".chars());

while let Some(digit) = it.next_if_map(|c| c.to_digit(10).ok_or(c)) {
    codepoint = codepoint * 10 + digit;
}
```

or with `next_if_map_mut`:

```rust
let mut it = Peekable::new("123".chars());

while let Some(digit) = iter.next_if_map_mut(|c| c.to_digit(10)) {
    line_num = line_num * 10 + digit;
}
```

Note that the major difference here is that `next_if_map_mut` does not get owned items from the iterator, but mutable references. With that api, the closure can return an `Option` which avoids an `ok_or`. This may require cloning or copying the iterator elements, so if that is expensive, the owned version, `next_if_map`, may be preferable.

### Nightly use

At the moment, this feature is barely used in nightly, though I've found multiple good uses for it in my own projects, hence my pushing for stabilization. It makes the kind of patterns used in recursive descent parsing super concise and maybe with its stabilization it will find more use.

### Test coverage

Besides a quite comprehensive doctest, this feature is tested (including panicking in the closure) here:

https://github.com/rust-lang/rust/blob/c880acdd3171dfafdb55be8cd9822a857e99348d/library/coretests/tests/iter/adapters/peekable.rs#L275-L359

## History

- ACP: rust-lang/libs-team#613 accepted with rust-lang/libs-team#613 (comment)
- implementation: rust-lang#143725 with tests, and no issues reported since july.

## Acknowledgments

ACP, implementation and tracking issue for this feature all by @kennytm <3
adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file

this adds the `Ordering` enum to `minicore.rs`.

consequently, this updates `tests/assembly-llvm/rust-abi-arg-attr.rs` to import `minicore` directly. previously, this test file contained traits like `Copy` `Clone` `PointeeSized`, which were giving a duplicate lang item error, so replace those by importing `minicore` completely.
…Jung

Unix implementation for stdio set/take/replace

Tracking issue: rust-lang#150667
ACP: rust-lang/libs-team#500
Reword the collect() docs

Update the `Iterator::collect` docs so they explain that the return type, not the iterator itself, determines which collection is built.

Follow up on rust-lang#121140
…acrum

Fix the connect_error test on FreeBSD 15+

On FreeBSD 15, the error code returned in this situation changed.  It's now ENETUNREACH.  I think that error code is reasonable, and it's documented for connect(2), so we should expect that it might be returned.
…ulacrum

Use `rand` crate more idiomatically

Small cleanup, found while working on something else.
We were using `rand` un-idiomatically in a couple of places, and it was bugging me...
mGCA: Support array expression as direct const arguments

tracking issue: rust-lang#132980
resolve: rust-lang#150612

Support array expression as direct const arguments (e. g. [1, 2, N]) in min_generic_const_args.

todo:
* [x] Rebase another mGCA PR
* [x] Add more test case
* [x] Modify clippy code
…lacrum

Bump `diesel` to the most recent commit in `cargotest`

`cargotest` can only detect the worst offenders (like tests failing, or hard compiler errors / ICEs), but regardless, bumping `diesel` to a way more recent version hopefully contributes slightly towards helping us not break `diesel` if at all possible.

That is, AFAIUI, this will not help catch [#t-compiler/prioritization/alerts > rust-lang#149845 Diesel stops building with nightly-2025-12-10 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/245100-t-compiler.2Fprioritization.2Falerts/topic/.23149845.20Diesel.20stops.20building.20with.20nightly-2025-12-10/near/566975273) because we cap-lints to `warn` in `cargotest`.

Most recent commit as of the time of this PR anyway.
std: sys: fs: uefi: Implement File::flush

- Also forward fsync and datasync to flush. UEFI does not have anything separate for metadata sync.

@rustbot label +O-UEFI
std: sys: fs: uefi: Implement File::seek

- Tested using OVMF on QEMU.

@rustbot label +O-UEFI
Remove special case for `AllowedTargets::CrateLevel`

r? @jdonszelmann
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Jan 11, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like 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-clippy Relevant to the Clippy team. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 11, 2026
@Zalathar Zalathar changed the title Rollup of 15 pull requests [EXPERIMENT] Rollup of 15 pull requests Jan 11, 2026
@Zalathar
Copy link
Member Author

Rollup of everything not in #150912 or #150923, to run some try jobs in parallel while the queue is clogged.

Please don't approve or close this PR.

@Zalathar
Copy link
Member Author

@bors try jobs=x86_64-msvc-1,i686-msvc-1,x86_64-mingw-1,test-various,armhf-gnu,aarch64-apple,x86_64-gnu-llvm-20-3,dist-various-2

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Jan 11, 2026
[EXPERIMENT] Rollup of 15 pull requests

try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: test-various
try-job: armhf-gnu
try-job: aarch64-apple
try-job: x86_64-gnu-llvm-20-3
try-job: dist-various-2
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 11, 2026

☀️ Try build successful (CI)
Build commit: bc6a591 (bc6a5918c1f86673bbb8c859b6c924e9ecbe0f7f, parent: f57eac1bf98cb5d578e3364b64365ec398c137df)

@Zalathar
Copy link
Member Author

Closing this PR as its purpose has been served, but it would also be a good basis for a real rollup to come after #150951 (and an intervening rollup=never PR).

@Zalathar Zalathar closed this Jan 11, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 11, 2026
@Zalathar Zalathar deleted the rollup-i8XDnqU branch January 11, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.