Skip to content

Move std::io::Read to alloc::io#158544

Open
bushrat011899 wants to merge 5 commits into
rust-lang:mainfrom
bushrat011899:core_io_read
Open

Move std::io::Read to alloc::io#158544
bushrat011899 wants to merge 5 commits into
rust-lang:mainfrom
bushrat011899:core_io_read

Conversation

@bushrat011899

@bushrat011899 bushrat011899 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

View all comments

ACP: rust-lang/libs-team#755
Tracking issue: #154046
Split From: #156527
Blocked On: #158541

Description

Moves std::io::Read to alloc::io. This is mostly a direct cut and paste, but with a large diff due to how many implementations need to be moved into alloc. Blocked on #158541.

There is some new code written for some of the Read implementations to account for the no_global_oom_handling configuration, since Vec::extend_from_slice and String::push_str are unavailable. I've highlighted all of these such instances with review comments for clarity.


Notes

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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 Jun 29, 2026
@rustbot

rustbot commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 13 candidates
  • Random selection from 6 candidates

@bushrat011899

Copy link
Copy Markdown
Contributor Author

@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 29, 2026
@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-bors

This comment has been minimized.

bushrat011899

This comment was marked as outdated.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@clarfonthey

Copy link
Copy Markdown
Contributor

r? clarfonthey since this is the next one in the sequence and Mark seemed fine with me doing this.

@rustbot

This comment has been minimized.

@rustbot

rustbot commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

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.

@bushrat011899

Copy link
Copy Markdown
Contributor Author

@rustbot ready
From this point on, std::io items can only be moved to alloc, as Read depends on Vec and String, and everything left either directly or indirectly relies on Read.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Jul 10, 2026
@bushrat011899

Copy link
Copy Markdown
Contributor Author

@rustbot label -T-compiler -T-rustdoc
I am pretty sure these labels are incorrectly applied because of some earlier rebase. T-rustdoc-frontend I believe is appropriate since the hardcoded URLs in one of their tests is now different.

@rustbot rustbot removed T-compiler Relevant to the compiler 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. labels Jul 10, 2026

/// For the specialization of `Bytes::next`.
#[doc(hidden)]
#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")]

@clarfonthey clarfonthey Jul 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't actually matter, but I guess this should be alloc_io_internals since Read can't be moved to core yet.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think I'll leave this one as-is if that's ok? Just makes things a tiny bit cleaner, even if the label isn't completely accurate.

Comment thread library/alloc/src/io/read.rs Outdated
Comment thread library/alloc/src/io/read.rs Outdated
Comment thread library/alloc/src/io/read.rs Outdated
Comment thread library/alloc/src/io/read.rs Outdated
bushrat011899 and others added 2 commits July 11, 2026 09:13
Co-Authored-By: Clar Fon <15850505+clarfonthey@users.noreply.github.com>
Co-Authored-By: Clar Fon <15850505+clarfonthey@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library 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.

4 participants