Closed
Conversation
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
Member
Author
|
@bors r+ rollup=never p=5 |
Contributor
This comment has been minimized.
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`)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 80f68dd failed: CI. Failed job:
|
Contributor
|
PR #154654, which is a member of this rollup, was unapproved. |
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:
std::io::ErrorKindtocore::io#154654 (Movestd::io::ErrorKindtocore::io)Index(Mut),Deref(Mut)forVec#155054 (constifyIndex(Mut),Deref(Mut)forVec)integer_cast_extras#154664 (core/num: Implement featureinteger_cast_extras)cfail/cpassrevisions tobfail/bpass#155474 (Rename incrementalcfail/cpassrevisions tobfail/bpass)mem::Alignment#155493 (docs(num): fix stale link tomem::Alignment)r? @ghost
Create a similar rollup