Skip to content

Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt - #162875

Open
json420 wants to merge 18 commits into
rust-lang:mainfrom
json420:seek_read_exact
Open

json420 wants to merge 18 commits into
rust-lang:mainfrom
json420:seek_read_exact

Conversation

@json420

@json420 json420 commented Sep 16, 2026

Copy link
Copy Markdown

Tracking issue: #162868

This adds .seek_read_exact() to std::os::windows::fs::FileExt, an exact port of read_exact_at() for std::os::unix::fs::FileExt.

And it adds .seek_write_all() to std::os::windows::fs::FileExt, an exact port of write_all_at() for std::os::unix::fs::FileExt.

Finally, it adds six tests.

First there is a smoke test for seek_read_exact(), seek_write_all(), an exact port of the test for the .seek_read(), .seek_write() methods. This is to make sure we are getting the same pass-through behavior through the lens of established tests.

Then there are five tests for the windows::fs::FileExt trait itself, covering all seek_read_exact(), seek_write_all() corner cases except io::ErrorKind::Interrupted (advise welcome on that one). These tests use mock implementations of the traits seek_read() and seek_write() methods.

No LLMs were used in writing this PR.

@rustbot rustbot added O-windows Operating system: Windows 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 Sep 16, 2026
@rustbot

rustbot commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @clarfonthey (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

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

Comment thread library/std/src/fs/tests.rs
@clarfonthey

Copy link
Copy Markdown
Contributor

LGTM minus test splitting.

@rustbot author

@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 Sep 17, 2026
@rustbot

rustbot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

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

@json420
json420 marked this pull request as draft September 17, 2026 21:50
@json420
json420 marked this pull request as ready for review September 18, 2026 19:11
@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 Sep 18, 2026
@json420

json420 commented Sep 18, 2026

Copy link
Copy Markdown
Author

@rustbot ready

@clarfonthey

Copy link
Copy Markdown
Contributor

@bors r+ rollup

Thank you!

@rust-bors

rust-bors Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 6ac2b72 has been approved by clarfonthey

It is now in the queue for this repository.

@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 Sep 18, 2026
@json420

json420 commented Sep 18, 2026

Copy link
Copy Markdown
Author

@clarfonthey No, thank you! Contributing to Rust is, like, a wildly pleasant experience for a first timer! Seriously. Thanks!

Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 19, 2026
…they

Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt

Tracking issue: rust-lang#162868

This adds `.seek_read_exact()` to `std::os::windows::fs::FileExt`, an exact port of `read_exact_at()` for `std::os::unix::fs::FileExt`.

And it adds `.seek_write_all()` to `std::os::windows::fs::FileExt`, an exact port of `write_all_at()` for `std::os::unix::fs::FileExt`.

Finally, it adds six tests.

First there is a smoke test for `seek_read_exact()`, `seek_write_all()`, an exact port of the test for the  `.seek_read()`, `.seek_write()` methods. This is to make sure we are getting the same pass-through behavior through the lens of established tests.

Then there are five tests for the `windows::fs::FileExt` trait itself, covering all `seek_read_exact()`, `seek_write_all()` corner cases except  `io::ErrorKind::Interrupted` (advise welcome on that one). These tests use mock implementations of the traits `seek_read()` and `seek_write()` methods.

No LLMs were used in writing this PR.
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
Rollup of 18 pull requests

Successful merges:

 - #162499 (`rustc_codegen_gcc` subtree update)
 - #161424 (implement `VaArgSafe` for `f128`)
 - #161777 (Add Natvis visualiser and debuginfo tests for `f128`)
 - #162506 (Avoid suggesting imports of traits declared inside fn bodies)
 - #162591 (Move parse error recovery for expression operators "out of line" & refactor in the area)
 - #162669 ([rustdoc] Correctly handle intra-doc links on inlined same item with different names)
 - #162733 (Add useful APIs to `Unique(Arc|Rc)`)
 - #162913 (Refactor LivenessResults into LivenessComputation, without typeck)
 - #162950 (More AST lowering cleanups)
 - #162964 (Update `browser-ui-test` version to `0.25.2`)
 - #162979 (mark `f128` as reliable on `powerpc64` with `+vsx`)
 - #161743 (Add performance notes for the floating-point round method)
 - #162797 (yeet AliasConstKind::opt_def_id)
 - #162836 (Ping T-libs-ping instead of T-libs-fcp for backports)
 - #162873 (Adjust `bug!`/`span_bug!` emission)
 - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt)
 - #162956 (Add missing `#[repr(C)]` in UI, codegen and assembly tests)
 - #162981 (rustc-dev-guide subtree update)

Failed merges:

 - #162177 (Properly implement the gpu-kernel ABI for amdgpu)
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
Rollup of 18 pull requests

Successful merges:

 - #162499 (`rustc_codegen_gcc` subtree update)
 - #161424 (implement `VaArgSafe` for `f128`)
 - #161777 (Add Natvis visualiser and debuginfo tests for `f128`)
 - #162506 (Avoid suggesting imports of traits declared inside fn bodies)
 - #162591 (Move parse error recovery for expression operators "out of line" & refactor in the area)
 - #162669 ([rustdoc] Correctly handle intra-doc links on inlined same item with different names)
 - #162733 (Add useful APIs to `Unique(Arc|Rc)`)
 - #162913 (Refactor LivenessResults into LivenessComputation, without typeck)
 - #162950 (More AST lowering cleanups)
 - #162964 (Update `browser-ui-test` version to `0.25.2`)
 - #162979 (mark `f128` as reliable on `powerpc64` with `+vsx`)
 - #161743 (Add performance notes for the floating-point round method)
 - #162797 (yeet AliasConstKind::opt_def_id)
 - #162836 (Ping T-libs-ping instead of T-libs-fcp for backports)
 - #162873 (Adjust `bug!`/`span_bug!` emission)
 - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt)
 - #162956 (Add missing `#[repr(C)]` in UI, codegen and assembly tests)
 - #162981 (rustc-dev-guide subtree update)

Failed merges:

 - #162177 (Properly implement the gpu-kernel ABI for amdgpu)
@JonathanBrouwer

Copy link
Copy Markdown
Member

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #162996 (comment)

@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 19, 2026
@rust-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#162996), which was unapproved.

View changes since this unapproval

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

Labels

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

4 participants