Skip to content

Move std::io::copy internals to alloc::io#158548

Open
bushrat011899 wants to merge 20 commits into
rust-lang:mainfrom
bushrat011899:alloc_io_copy_internals
Open

Move std::io::copy internals to alloc::io#158548
bushrat011899 wants to merge 20 commits into
rust-lang:mainfrom
bushrat011899:alloc_io_copy_internals

Conversation

@bushrat011899

@bushrat011899 bushrat011899 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

Description

Moves the generic implementation of std::io::copy to alloc::io. This is effectively a direct cut and paste. Blocked on #158547.

Worth considering is how we may want to expose the generic copy function for end users. Currently, std only exposes std::io::copy, which internally uses kernel_copy and falls back onto generic_copy as required. We could expose generic_copy as alloc::io::copy, but then alloc::io::copy and std::io::copy would be different functions. There are instances where that already happens (core::panic! is not the same as std::panic! for example), but this would be an easy mistake to make with performance implications.

Alternatively, EII could allow the kernel_copy function to be provided to alloc, so the full copy function is defined in alloc::io and then reexported in std::io. But that's dependent on EII being more stable.

For now, this PR just moves generic_copy to signal that the full std::io::copy is very close to being able to be moved into alloc::io.


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? @clarfonthey

rustbot has assigned @clarfonthey.
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.

@bushrat011899 bushrat011899 force-pushed the alloc_io_copy_internals branch from 1bcdfe1 to 43f67ba Compare July 2, 2026 02:01
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@bushrat011899 bushrat011899 force-pushed the alloc_io_copy_internals branch from 43f67ba to 90ec159 Compare July 2, 2026 02:20
@bushrat011899 bushrat011899 force-pushed the alloc_io_copy_internals branch from 90ec159 to 8139972 Compare July 3, 2026 03:50
@rustbot

rustbot commented Jul 3, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-blocked Status: Blocked on something else such as an RFC or other implementation work. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants