Skip to content

[WIP]: Move std::io into alloc and core #156527

Draft
bushrat011899 wants to merge 14 commits into
rust-lang:mainfrom
bushrat011899:core_io_test_merge
Draft

[WIP]: Move std::io into alloc and core #156527
bushrat011899 wants to merge 14 commits into
rust-lang:mainfrom
bushrat011899:core_io_test_merge

Conversation

@bushrat011899
Copy link
Copy Markdown
Contributor

@bushrat011899 bushrat011899 commented May 13, 2026

View all comments

ACP: rust-lang/libs-team#755
Tracking issue: #154046
Blocked on: #155625
Blocked on: #155849

Description

Moves as much of std::io into core::io and alloc::io as practically possible. Work In Progress until the prerequisite PRs are merged. Likely has documentation issues that will need to be resolved. Will almost certainly be split into smaller PRs as +/- 5000 LoC is a bit much for a single PR IMO.


Notes

  • No AI tooling of any kind was used during the creation of this PR.

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. labels May 13, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Comment thread library/std/src/io/mod.rs Outdated
Comment thread library/std/src/sys/stdio/unix.rs Outdated
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

error[E0425]: cannot find value `DEFAULT_BUF_SIZE` in this scope
  --> library/std/src/io/copy/tests.rs:58:43
   |
58 |     assert!(w.get_mut().observed_buffer > DEFAULT_BUF_SIZE, "expected coalesced writes");
   |                                           ^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DEFAULT_BUF_SIZE` in this scope
  --> library/std/src/io/copy/tests.rs:72:22
   |
72 |     assert!(buf_sz > DEFAULT_BUF_SIZE, "test precondition");
   |                      ^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DEFAULT_BUF_SIZE` in this scope
  --> library/std/src/io/copy/tests.rs:85:15
   |
85 |     let cap = DEFAULT_BUF_SIZE * 10;
   |               ^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DEFAULT_BUF_SIZE` in this scope
  --> library/std/src/io/copy/tests.rs:86:72
   |
86 |     let mut source = ShortReader { cap, observed_buffer: 0, read_size: DEFAULT_BUF_SIZE };
   |                                                                        ^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DEFAULT_BUF_SIZE` in this scope
  --> library/std/src/io/copy/tests.rs:92:34
   |
---

error[E0658]: use of unstable library feature `buf_read_has_data_left`
   --> library/std/src/io/tests.rs:109:18
    |
109 |     assert!(!buf.has_data_left().unwrap());
    |                  ^^^^^^^^^^^^^
    |
    = note: see issue #86423 <https://github.com/rust-lang/rust/issues/86423> for more information
    = help: add `#![feature(buf_read_has_data_left)]` to the crate attributes to enable
    = note: this compiler was built on 2026-05-13; consider upgrading it if it is out of date

error[E0599]: no method named `initialized` found for struct `realstd::io::BufReader<R>` in the current scope
    --> library/std/src/io/buffered/tests.rs:1070:21
     |
1070 |     assert!(!reader.initialized());
     |                     ^^^^^^^^^^^ method not found in `realstd::io::BufReader<OneByteReader>`

error[E0599]: no method named `initialized` found for struct `realstd::io::BufReader<R>` in the current scope
    --> library/std/src/io/buffered/tests.rs:1076:20
     |
1076 |     assert!(reader.initialized());
     |                    ^^^^^^^^^^^ method not found in `realstd::io::BufReader<OneByteReader>`

Some errors have detailed explanations: E0425, E0432, E0599, E0658.
For more information about an error, try `rustc --explain E0425`.
[RUSTC-TIMING] std test:true 15.734
error: could not compile `std` (lib test) due to 11 previous errors

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

Labels

O-unix Operating system: Unix-like S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants