Skip to content

Conversation

joboet
Copy link
Member

@joboet joboet commented Sep 26, 2025

Part of #117276.

The current organisation of the kernel_copy mechanism used to specialise io::copy on Linux necessitated circular links between the io::copy module and the implementation in sys::pal::unix::kernel_copy, as well as presenting an exception to the tidy PAL rule that forbids OS-based #[cfg]s outside of sys and os.

This PR fixes this by moving kernel_copy to sys (as per #117276) and returning a CopyState from that function specifying whether io::copy should use its fallback. The kernel_copy function on other platforms just unconditionally returns CopyState::Fallback.

@rustbot rustbot added A-tidy Area: The tidy tool O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 26, 2025

r? @ibraheemdev

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tidy Area: The tidy tool O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants