Move std::io::ErrorKind to core::io#154654
Move std::io::ErrorKind to core::io#154654bushrat011899 wants to merge 3 commits intorust-lang:mainfrom
std::io::ErrorKind to core::io#154654Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
6acf3fc to
0c00e70
Compare
This comment has been minimized.
This comment has been minimized.
0c00e70 to
a87a02a
Compare
This comment has been minimized.
This comment has been minimized.
8faa574 to
0ef55d6
Compare
This comment has been minimized.
This comment has been minimized.
0ef55d6 to
3e16c8b
Compare
This comment has been minimized.
This comment has been minimized.
3e16c8b to
56dfe2e
Compare
This comment has been minimized.
This comment has been minimized.
56dfe2e to
aa24135
Compare
This comment has been minimized.
This comment has been minimized.
aa24135 to
f25b166
Compare
This comment has been minimized.
This comment has been minimized.
94753ea to
b0ce24e
Compare
It may be controversial, but it has been accepted in principle by libs-teams, so it should be fine. |
I hope so! I really want your PR to land. Regardless of whether it does, this is a good follow-up to go further at basically no cost. |
|
looks good to me |
Rollup of 8 pull requests Successful merges: - #155370 (Add regression test for dead code elimination with drop + panic) - #154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser) - #155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`) - #155431 (Add temporary scope to assert_matches) - #152995 (ACP Implementation of PermissionsExt for Windows ) - #153873 (deprecate `std::char` constants and functions) - #154654 (Move `std::io::ErrorKind` to `core::io`) - #154865 (libtest: use binary search for --exact test filtering)
|
This pull request was unapproved. This PR was contained in a rollup (#155503), which was unapproved. |
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`
3c03144 to
74d5469
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors try jobs=dist-various-* |
This comment has been minimized.
This comment has been minimized.
Move `std::io::ErrorKind` to `core::io` try-job: dist-various-*
|
@rustbot ready |
|
@bors r+ rollup=iffy |
…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!
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`)
|
This pull request was unapproved. This PR was contained in a rollup (#155534), which was unapproved. |
| /// # Examples | ||
| /// | ||
| /// ```no_run | ||
| /// #![feature(core_io)] |
There was a problem hiding this comment.
This line is not required and was the cause of the roll-up failure. Will remove and update commit history once I'm back home.
View all comments
ACP: rust-lang/libs-team#755
Tracking issue: #154046
Related: #152918
Description
I consider #154046 to be really important for
no_std, but I'm concerned #152918 might be too controversial. As an alternative, I'd like to propose starting small withErrorKind, since it can be moved somewhat trivially. It has no dependencies on functionality instd, no platform specific behaviour, and could provide an excellent bridging point forno_stdIO libraries.Since
std::io::ErrorimplementsFrom<ErrorKind>, libraries could write functions which returnResult<T, core::io::ErrorKind>, and therefore be usable instd-using libraries with the?operator. For that reason, I'd consider this to be a worthwhile change even if the rest ofstd::iocouldn't be moved tocore/alloc, and entirely compatible with any efforts to make such a change in the future.Notes