Skip to content

Move std::io::util to core::io#156431

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
bushrat011899:core_io_util
May 12, 2026
Merged

Move std::io::util to core::io#156431
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
bushrat011899:core_io_util

Conversation

@bushrat011899
Copy link
Copy Markdown
Contributor

View all comments

ACP: rust-lang/libs-team#755
Tracking issue: #154046
Subset of: #154684

Description

Moves utility types and functions from std::io::util and std::io to core::io, leaving any IO trait implementations behind. They will be moved along with the traits themselves. Certain documentation links had to be amended.

  • Chain
  • Empty
  • Repeat
  • Sink
  • Take
  • empty
  • repeat
  • sink

Notes

  • This can be reviewed independently of the other PRs tracked in Tracking Issue for alloc::io and core::io #154046.
  • Chain and Take were previously in the main mod.rs file for std::io, but I've chosen to move them into the util.rs file in core::io instead. I think they make more sense in that file, but I'm happy to move them into mod.rs if that's a controversial decision.
  • No AI tooling of any kind was used during the creation of this PR.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 11, 2026
@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label May 11, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 11, 2026

r? @nia-e

rustbot has assigned @nia-e.
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: @scottmcm, libs
  • @scottmcm, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, nia-e, scottmcm

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Copy link
Copy Markdown
Member

@nia-e nia-e left a comment

Choose a reason for hiding this comment

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

Requested a few small changes, but overall looks great ^^ ty!

View changes since this review

Comment thread library/core/src/io/util.rs
Comment thread library/std/src/io/util.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 12, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 12, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@bushrat011899
Copy link
Copy Markdown
Contributor Author

@rustbot ready

Pending CI passing, which I expect it to due to the minor nature of the changes involved.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 12, 2026
@nia-e
Copy link
Copy Markdown
Member

nia-e commented May 12, 2026

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 12, 2026

📌 Commit 5cbf9f8 has been approved by nia-e

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 12, 2026
rust-bors Bot pushed a commit that referenced this pull request May 12, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #156287 (move more compiler crates away from `box_patterns` )
 - #156428 (Move `std::io::Cursor` to `core::io`)
 - #156431 (Move `std::io::util` to `core::io`)
 - #156145 (Move tests cast)
 - #156284 (resolve: Fix a false positive "cannot reexport" error for ambiguous glob sets)
 - #156502 (Give an example of a Ctor in the doc-comments)
rust-bors Bot pushed a commit that referenced this pull request May 12, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #156287 (move more compiler crates away from `box_patterns` )
 - #156428 (Move `std::io::Cursor` to `core::io`)
 - #156431 (Move `std::io::util` to `core::io`)
 - #156145 (Move tests cast)
 - #156284 (resolve: Fix a false positive "cannot reexport" error for ambiguous glob sets)
 - #156502 (Give an example of a Ctor in the doc-comments)
@rust-bors rust-bors Bot merged commit ac656cb into rust-lang:main May 12, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 12, 2026
@Mark-Simulacrum
Copy link
Copy Markdown
Member

@rust-timer build 7a40b5e

cc #156506 (comment)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (7a40b5e): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
1.3% [1.3%, 1.3%] 1
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-1.0%, -0.1%] 9
All ❌✅ (primary) 1.3% [1.3%, 1.3%] 1

Max RSS (memory usage)

Results (primary -2.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-6.8% [-6.8%, -6.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.7% [-6.8%, 1.4%] 2

Cycles

Results (primary -2.1%, secondary 4.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.2% [3.4%, 5.6%] 3
Improvements ✅
(primary)
-2.1% [-2.1%, -2.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.1% [-2.1%, -2.1%] 1

Binary size

Results (primary 4.4%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
4.4% [4.4%, 4.4%] 1
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.4% [4.4%, 4.4%] 1

Bootstrap: 510.527s -> 523.299s (2.50%)
Artifact size: 400.06 MiB -> 398.07 MiB (-0.50%)

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

Labels

perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants