Move IoSlice and IoSliceMut to core::io#155849
Conversation
|
r? @jhpratt rustbot has assigned @jhpratt. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
227cc04 to
868ecad
Compare
This comment has been minimized.
This comment has been minimized.
868ecad to
37093d7
Compare
|
a long awating staff, thanks. |
This comment has been minimized.
This comment has been minimized.
37093d7 to
987b7d7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
987b7d7 to
5f6ae4a
Compare
This comment has been minimized.
This comment has been minimized.
5f6ae4a to
1cf7794
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. |
- Unsafe core must be documented. - Types from dependencies must be inlined. - These types are only used within `core` so `pub` must be replaced with `pub(crate)`.
1cf7794 to
c1f8dbe
Compare
|
I've split this PR into 3 commits to better highlight how little actually changes in order to facilitate this move. For reviewers, I recommend going through each commit individually. |
c1f8dbe to
ac81554
Compare
|
As a heads up, I am currently exploring Europe and won't be home for a couple more weeks. If you'd like a review before then, feel free to reroll. |
Thanks for the heads up, hope you have a great time! r? libs |
This comment was marked as outdated.
This comment was marked as outdated.
|
I will probably also take a day or two before I can get to this, but given the stuff it's touching it's likely worth a perf run: @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Move `IoSlice` and `IoSliceMut` to `core::io`
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (3b58d69): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.5%, secondary 0.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 509.956s -> 530.998s (4.13%) |
View all comments
ACP: rust-lang/libs-team#755
Tracking issue: #154046
Related: #152918
Related: #155625
Description
Moves
std::io::IoSliceandstd::io::IoSliceMutintocore::io. This is required for theReadandWritetraits to be moved intoallocand/orcore, as they contain stable methods which work with IO slices. Similar to #155574, this PR inlines thestd::systypes required to create an ABI compatible type for the platforms where such compatibility is guaranteed.Additionally, I've moved the relevant tests out of
std::io::testsintocoretests::io::io_slice.Notes
std::iotoalloc#152918, but goes further than moving the IO slice types toallocand instead moves them straight tocore. Since these types have no interaction with allocation, and doing so will allowWriteto move tocore::io, I consider this a better home for these types.core::sysmodule can be found here.unsupportedtogenericto better reflect thatIoSlice(Mut)is supported by all platforms, it just doesn't have a special ABI-compatible type. I don't want to imply that parts ofcore"don't work" depending on the target;IoSlice(Mut)works exactly as expected on all targets.pubitems within each platform-specific representationpub(super)to highlight that everything withincore::io::io_sliceis an internal implementation detail not meant for any other part of the crate to be aware of.