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 |
|
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
c690493 to
16624a6
Compare
This comment has been minimized.
This comment has been minimized.
16624a6 to
70e9804
Compare
|
@rustbot ready |
| pub mod char; | ||
| pub mod ffi; | ||
| #[unstable(feature = "core_io_borrowed_buf", issue = "117693")] | ||
| #[unstable(feature = "core_io", issue = "154046")] |
There was a problem hiding this comment.
Hm, I suspect we should stabilize the module existing (while leaving everything in it unstable). Otherwise it's annoying for everyone downstream to need two feature gates, and I think it's highly likely we do in fact want the module long-term.
Let me nominate #154046 for libs-api so they can decide if that seems reasonable.
There was a problem hiding this comment.
I assume that would need to be done in a different PR, and this rebased if/when that's merged?
There was a problem hiding this comment.
Based on this comment I'm merging io_error_kind_in_core into core_io. As a followup, it may be worth removing the core_io_borrowed_buf feature entirely, and using the read_buf feature std::io uses for BorrowedBuf and BorrowedCursor instead. That would still require two features to use borrowed buffers from core, but one of those is already required to use it from std anyway, so I think not too bad.
|
@rustbot blocked Marking as blocked until the module |
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`
6e85e83 to
3c03144
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. |
|
@rustbot ready |
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