Skip to content

Rollup of 6 pull requests#155534

Closed
jhpratt wants to merge 15 commits intorust-lang:mainfrom
jhpratt:rollup-yAM8Y9R
Closed

Rollup of 6 pull requests#155534
jhpratt wants to merge 15 commits intorust-lang:mainfrom
jhpratt:rollup-yAM8Y9R

Conversation

@jhpratt
Copy link
Copy Markdown
Member

@jhpratt jhpratt commented Apr 20, 2026

Successful merges:

r? @ghost

Create a similar rollup

okaneco and others added 15 commits April 1, 2026 15:42
Implement saturating, checked, and strict casting between
signed and unsigned integer primitives of the same bit-width.

Add `cast_integer` function to `overflow_panic.rs`
Long ago, UI tests were divided into "compile" and "run" tests. Later, the
compile tests were further subdivided into "check" and "build" tests, to speed
up tests that don't need a full build.

The same split was never applied to incremental test revisions, so the only way
to perform a check build in incremental tests is (confusingly) to use a `cfail`
revision and then specify `//@ check-fail` or `//@ check-pass`.

This PR makes room for dedicated check-fail and check-pass revisions by
renaming the existing `cfail` and `cpass` revisions to `bfail` and `bpass`,
since they currently perform a full build.
Certain links will not be valid when moved into `core::io`
* Checking exhaustion will no longer be possible for `repr_bitpacked`. Moving `kind_from_prim` into an associated function, and setting it up to be moved into `core::io` as well.
* `ErrorKind::as_str` is private, but it's only usage is trivially replaced with `Display::fmt`
* The features io_error_inprogress, io_error_more, and io_error_uncategorized will all need to be enabled
Move `std::io::ErrorKind` to `core::io`
* Update `rustdoc-html` tests for the new path
* Add `core_io` feature to control stability. This replaces the use of `core_io_borrowed_buf` on the `core::io` module itself.
* Re-export `core::io::ErrorKind` in `std::io::error`
…r=Mark-Simulacrum

Move `std::io::ErrorKind` to `core::io`

ACP: rust-lang/libs-team#755
Tracking issue: rust-lang#154046
Related: rust-lang#152918

## Description

I consider rust-lang#154046 to be really important for `no_std`, but I'm concerned rust-lang#152918 might be too controversial. As an alternative, I'd like to propose starting small with `ErrorKind`, since it can be moved somewhat trivially. It has no dependencies on functionality in `std`, no platform specific behaviour, and could provide an excellent bridging point for `no_std` IO libraries.

Since `std::io::Error` implements `From<ErrorKind>`, libraries could write functions which return `Result<T, core::io::ErrorKind>`, and therefore be usable in `std`-using libraries with the `?` operator. For that reason, I'd consider this to be a worthwhile change even if the rest of `std::io` couldn't be moved to `core`/`alloc`, and entirely compatible with any efforts to make such a change in the future.

## Notes

* This is my first PR against Rust, please let me know if there's anything I should be doing that I have not done. I tried reading through the library contributors guide but I'm sure I've missed _something_.
* No AI tooling of any kind was used in the creation of this PR.
* I believe it's appropriate that this be a part of the linked tracking issue, but please let me know if that's not the case!
…lnay

constify `Index(Mut)`, `Deref(Mut)` for `Vec`

Relevant tracking issues
const_convert: rust-lang#143773
const_index: rust-lang#143775
suggest expect instead of unwrap when arg provided

r? mejrs (feel free to reroll)

fixes rust-lang#155502
…ttmcm

core/num: Implement feature `integer_cast_extras`

Tracking issue rust-lang#154650
Accepted ACP rust-lang/libs-team#765 (comment)

Implement `saturating`, `checked`, and `strict` casting between signed and unsigned integer primitives of the same bit-width.

Add `cast_integer` panic function to `overflow_panic.rs`
Rename incremental `cfail`/`cpass` revisions to `bfail`/`bpass`

Long ago, UI tests were divided into *compile* and *run* tests. Later, the compile tests were further subdivided into *check* and *build* tests, to speed up tests that don't need a full build.

The same split was never applied to incremental test revisions, so the only way to perform a check build in incremental tests is (confusingly) to use a `cfail` revision and then specify `//@ check-fail` or `//@ check-pass`.

This PR makes room for dedicated check-fail and check-pass revisions by renaming the existing `cfail` and `cpass` revisions to `bfail` and `bpass`, since they currently perform a full build.

---

The test updates were done with a regex whole-word find-and-replace for `c(fail|pass)(\d*)`, and I also took the opportunity to manually add a space after `revisions:` on affected lines.

r? jieyouxu
…, r=scottmcm

docs(num): fix stale link to `mem::Alignment`

This pull request updates a stale link to `mem::Alignment` in `num::IntErrorKind`.

In rust-lang#153178, I added a link to `Alignment` in `IntErrorKind`, but I overlooked that `Alignment` had been moved from `core::ptr` to `core::mem`. Although it is still re-exported in `core::ptr`, this pull request points the link to its canonical location.

@rustbot label +A-docs
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Apr 20, 2026
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide 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-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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Apr 20, 2026
@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Apr 20, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 20, 2026

📌 Commit b0c8117 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 Apr 20, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 20, 2026
Rollup of 6 pull requests

Successful merges:

 - #154654 (Move `std::io::ErrorKind` to `core::io`)
 - #155054 (constify `Index(Mut)`, `Deref(Mut)` for `Vec`)
 - #155507 (suggest expect instead of unwrap when arg provided)
 - #154664 (core/num: Implement feature `integer_cast_extras`)
 - #155474 (Rename incremental `cfail`/`cpass` revisions to `bfail`/`bpass`)
 - #155493 (docs(num): fix stale link to `mem::Alignment`)
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-msvc-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

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

rust-bors Bot commented Apr 20, 2026

💔 Test for 80f68dd failed: CI. Failed job:

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 20, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 20, 2026

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

@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 20, 2026
@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 Apr 20, 2026
@jhpratt jhpratt deleted the rollup-yAM8Y9R branch April 20, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide 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-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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants