Skip to content

Move SizeHint and IoHandle to core::io - #158539

Merged
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
bushrat011899:core_io_internal_traits
Jul 5, 2026
Merged

rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
bushrat011899:core_io_internal_traits

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

Description

Move both of these internal IO traits to core::io. Since these are already unstable this is just a simple move with no observable changes.


Notes

@rustbot rustbot added 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. 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: libs
  • libs expanded to 12 candidates
  • Random selection from 6 candidates

@bushrat011899
bushrat011899 force-pushed the core_io_internal_traits branch from 9d4811b to 4746813 Compare June 29, 2026 05:07
@clarfonthey

clarfonthey commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Appreciate the split PRs, thinking of offering up reviewing all of them since I'm not sure they benefit from multiple reviewers (and I already got two of them, which appear two of the latest in the chain).

But, will take a closer look today when I'm at my computer.

(Right now, replying to this one since it appears to be the "first" in the sequence.)

Comment thread library/core/src/io/size_hint.rs Resolved
@clarfonthey

Copy link
Copy Markdown
Contributor

LGTM minus the docs I mentioned. Some things look a bit weird since they're organised for future PRs but that's fine.

@clarfonthey

Copy link
Copy Markdown
Contributor

r? @clarfonthey

bushrat011899 and others added 2 commits July 3, 2026 10:08
This enforces the invariant that `size_hint` should always return `(lower_bound(), upper_bound())`.
Leaving the trait in a better state than it previously was.

Co-Authored-By: Clar Fon <15850505+clarfonthey@users.noreply.github.com>
@bushrat011899
bushrat011899 requested a review from clarfonthey July 3, 2026 00:12
@clarfonthey

Copy link
Copy Markdown
Contributor

@bors r+ rollup

Should be relatively safe to merge, just had wanted to wait for the tests to pass again. Going to just wait for this to be present in a rollup before dependent PRs get merged.

@rust-bors

rust-bors Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c2f51ae has been approved by clarfonthey

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 10. 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 Jul 3, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 3, 2026
…its, r=clarfonthey

Move `SizeHint` and `IoHandle` to `core::io`

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

## Description

Move both of these internal IO traits to `core::io`. Since these are already unstable this is just a simple move with no observable changes.

---

## Notes

* No AI tooling of any kind was used during the creation of this PR.
* Please see rust-lang#154046 (comment) for a review order and broader context for this PR.
rust-bors Bot pushed a commit that referenced this pull request Jul 5, 2026
Rollup of 18 pull requests

Successful merges:

 - #158692 (Add release notes for 1.96.1)
 - #134021 (Implement `IntoIterator` for `[&[mut]] Box<[T; N], A>`)
 - #152860 (Port the `without_debuginfo` test from `backtrace-rs` to the testsuite)
 - #155932 (MIR Call terminator: evaluate destination place before arguments)
 - #156777 (Add -Zautodiff_post_passes flag to limit which llvm passes to run after enzyme to make autodiff tests more robust)
 - #157151 (JSON target specs: remove 'x86-softfloat' compatibility alias)
 - #157835 (expand free alias types in the auto-trait orphan check)
 - #158377 (add `-Zforce-intrinsic-fallback` flag)
 - #158434 (delegation: refactor AST -> HIR lowering)
 - #158552 (make some tidy errors around python easier to understand)
 - #158624 (borrowck: Introduce BlameConstraint::to_obligation_cause_from_path())
 - #158704 (Optimize `ArrayChunks::try_rfold` with `DoubleEndedIterator::next_chunk_back`)
 - #158711 (library: Comment on libtest's dicey internal soundness)
 - #158539 (Move `SizeHint` and `IoHandle` to `core::io`)
 - #158659 (refactor the normalization in `coerce_shared_info`)
 - #158689 (resolver: don't use `Finalize` when resolving visibilities during AST expansion)
 - #158698 (Update TypeVisitable implementation)
 - #158706 (Tweaks to MIR building scope API)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 5, 2026
…its, r=clarfonthey

Move `SizeHint` and `IoHandle` to `core::io`

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

## Description

Move both of these internal IO traits to `core::io`. Since these are already unstable this is just a simple move with no observable changes.

---

## Notes

* No AI tooling of any kind was used during the creation of this PR.
* Please see rust-lang#154046 (comment) for a review order and broader context for this PR.
rust-bors Bot pushed a commit that referenced this pull request Jul 5, 2026
…uwer

Rollup of 20 pull requests

Successful merges:

 - #158692 (Add release notes for 1.96.1)
 - #134021 (Implement `IntoIterator` for `[&[mut]] Box<[T; N], A>`)
 - #155932 (MIR Call terminator: evaluate destination place before arguments)
 - #155989 (Update `transmute_copy` to ub_checks and `?Sized`)
 - #156777 (Add -Zautodiff_post_passes flag to limit which llvm passes to run after enzyme to make autodiff tests more robust)
 - #157151 (JSON target specs: remove 'x86-softfloat' compatibility alias)
 - #157835 (expand free alias types in the auto-trait orphan check)
 - #157857 (Stabilize `#[my_macro] mod foo;` (part of `proc_macro_hygiene`))
 - #158377 (add `-Zforce-intrinsic-fallback` flag)
 - #158434 (delegation: refactor AST -> HIR lowering)
 - #158552 (make some tidy errors around python easier to understand)
 - #158624 (borrowck: Introduce BlameConstraint::to_obligation_cause_from_path())
 - #158704 (Optimize `ArrayChunks::try_rfold` with `DoubleEndedIterator::next_chunk_back`)
 - #158711 (library: Comment on libtest's dicey internal soundness)
 - #158751 (rustdoc: Fix crash when trying to inline foreign item which cannot have attributes)
 - #158539 (Move `SizeHint` and `IoHandle` to `core::io`)
 - #158659 (refactor the normalization in `coerce_shared_info`)
 - #158689 (resolver: don't use `Finalize` when resolving visibilities during AST expansion)
 - #158698 (Update TypeVisitable implementation)
 - #158706 (Tweaks to MIR building scope API)
rust-bors Bot pushed a commit that referenced this pull request Jul 5, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - #158692 (Add release notes for 1.96.1)
 - #134021 (Implement `IntoIterator` for `[&[mut]] Box<[T; N], A>`)
 - #155932 (MIR Call terminator: evaluate destination place before arguments)
 - #155989 (Update `transmute_copy` to ub_checks and `?Sized`)
 - #156777 (Add -Zautodiff_post_passes flag to limit which llvm passes to run after enzyme to make autodiff tests more robust)
 - #157151 (JSON target specs: remove 'x86-softfloat' compatibility alias)
 - #157835 (expand free alias types in the auto-trait orphan check)
 - #157857 (Stabilize `#[my_macro] mod foo;` (part of `proc_macro_hygiene`))
 - #158434 (delegation: refactor AST -> HIR lowering)
 - #158552 (make some tidy errors around python easier to understand)
 - #158624 (borrowck: Introduce BlameConstraint::to_obligation_cause_from_path())
 - #158704 (Optimize `ArrayChunks::try_rfold` with `DoubleEndedIterator::next_chunk_back`)
 - #158711 (library: Comment on libtest's dicey internal soundness)
 - #158751 (rustdoc: Fix crash when trying to inline foreign item which cannot have attributes)
 - #158539 (Move `SizeHint` and `IoHandle` to `core::io`)
 - #158659 (refactor the normalization in `coerce_shared_info`)
 - #158689 (resolver: don't use `Finalize` when resolving visibilities during AST expansion)
 - #158698 (Update TypeVisitable implementation)
 - #158706 (Tweaks to MIR building scope API)
@rust-bors
rust-bors Bot merged commit cbc0b05 into rust-lang:main Jul 5, 2026
13 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jul 5, 2026
@theemathas theemathas modified the milestones: 1.98.0, 1.99.0 Jul 6, 2026
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Jul 6, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#158692 (Add release notes for 1.96.1)
 - rust-lang/rust#134021 (Implement `IntoIterator` for `[&[mut]] Box<[T; N], A>`)
 - rust-lang/rust#155932 (MIR Call terminator: evaluate destination place before arguments)
 - rust-lang/rust#155989 (Update `transmute_copy` to ub_checks and `?Sized`)
 - rust-lang/rust#156777 (Add -Zautodiff_post_passes flag to limit which llvm passes to run after enzyme to make autodiff tests more robust)
 - rust-lang/rust#157151 (JSON target specs: remove 'x86-softfloat' compatibility alias)
 - rust-lang/rust#157835 (expand free alias types in the auto-trait orphan check)
 - rust-lang/rust#157857 (Stabilize `#[my_macro] mod foo;` (part of `proc_macro_hygiene`))
 - rust-lang/rust#158434 (delegation: refactor AST -> HIR lowering)
 - rust-lang/rust#158552 (make some tidy errors around python easier to understand)
 - rust-lang/rust#158624 (borrowck: Introduce BlameConstraint::to_obligation_cause_from_path())
 - rust-lang/rust#158704 (Optimize `ArrayChunks::try_rfold` with `DoubleEndedIterator::next_chunk_back`)
 - rust-lang/rust#158711 (library: Comment on libtest's dicey internal soundness)
 - rust-lang/rust#158751 (rustdoc: Fix crash when trying to inline foreign item which cannot have attributes)
 - rust-lang/rust#158539 (Move `SizeHint` and `IoHandle` to `core::io`)
 - rust-lang/rust#158659 (refactor the normalization in `coerce_shared_info`)
 - rust-lang/rust#158689 (resolver: don't use `Finalize` when resolving visibilities during AST expansion)
 - rust-lang/rust#158698 (Update TypeVisitable implementation)
 - rust-lang/rust#158706 (Tweaks to MIR building scope API)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 6, 2026
…fonthey

Move `std::io::Seek` to `core::io`

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

## Description

Moves `std::io::Seek` and `SeekFrom` to `core::io`. This is a pretty simple migration, but it is blocked by rust-lang#158539.

---

## Notes

* No AI tooling of any kind was used during the creation of this PR.
* Please see rust-lang#154046 (comment) for a review order and broader context for this PR.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 6, 2026
…fonthey

Move `std::io::Seek` to `core::io`

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

## Description

Moves `std::io::Seek` and `SeekFrom` to `core::io`. This is a pretty simple migration, but it is blocked by rust-lang#158539.

---

## Notes

* No AI tooling of any kind was used during the creation of this PR.
* Please see rust-lang#154046 (comment) for a review order and broader context for this PR.
rust-timer added a commit that referenced this pull request Jul 6, 2026
Rollup merge of #158540 - bushrat011899:core_io_seek, r=clarfonthey

Move `std::io::Seek` to `core::io`

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

## Description

Moves `std::io::Seek` and `SeekFrom` to `core::io`. This is a pretty simple migration, but it is blocked by #158539.

---

## Notes

* No AI tooling of any kind was used during the creation of this PR.
* Please see #154046 (comment) for a review order and broader context for this PR.
@clarfonthey clarfonthey added the A-io Area: `std::io` (note: `std::fs`, `std::net`, `std::path` are A-filesystem, A-net, A-path) label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-io Area: `std::io` (note: `std::fs`, `std::net`, `std::path` are A-filesystem, A-net, A-path) 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.

5 participants