Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt - #162875
Conversation
|
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:
|
|
LGTM minus test splitting. @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
|
@bors r+ rollup Thank you! |
|
@clarfonthey No, thank you! Contributing to Rust is, like, a wildly pleasant experience for a first timer! Seriously. Thanks! |
…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.
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)
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)
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. Link to failure: #162996 (comment) |
|
This pull request was unapproved. This PR was contained in a rollup (#162996), which was unapproved. |
|
@bors try test-x86_64-msvc-1 |
|
@bors r+ rollup Second try's a charm! |
…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.
Rollup of 13 pull requests Successful merges: - #158515 (Make let-else respect macro_rules expr metavariable grouping) - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor) - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner) - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes) - #162990 (post GH comment on types nominations) - #154665 (add safety section for mem::zeroed) - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription) - #162705 (Trigger "C array" parse error recovery in far fewer cases) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162988 (recover `true` and `false` in type position as `bool`) - #162995 (Constify `impl FromStr for NonZero<T>`) - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics) - #163007 (add Dir::try_clone)
…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.
…uwer Rollup of 15 pull requests Successful merges: - #158515 (Make let-else respect macro_rules expr metavariable grouping) - #162726 (std: fix unix socket address panic on a full sun_path) - #160028 (Better account for `Self` that might be a typo of `self`) - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor) - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner) - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes) - #162990 (post GH comment on types nominations) - #154665 (add safety section for mem::zeroed) - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription) - #162705 (Trigger "C array" parse error recovery in far fewer cases) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162988 (recover `true` and `false` in type position as `bool`) - #162995 (Constify `impl FromStr for NonZero<T>`) - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics) - #163007 (add Dir::try_clone)
|
Could you squash away the fixup & micro commits? I'm talking about commits like the "whitespace" & the "period" one. 20 commits is tad much in this case. Thanks for your understanding! @bors r- |
|
This pull request was unapproved. This PR was contained in a rollup (#163038), which was unapproved. |
|
@bors squash |
This comment has been minimized.
This comment has been minimized.
…leExt * First pass at windows::fs::FileExt.seek_read_exact() * First pass at windows::fs::FileExt.seek_write_all() * Fix function signature in seek_read_exact(), duh * First pass at tests for .seek_read_exact(), seek_write_all() * Whitespace fix * Use hypothetical seek_read_exact_seek_write_all feature also for .seek_read_exact() * Tracking issues 162868 * Oops, fix seek_write_all() doc example, was using write_all_at() still * Add mocked test for windows FileExt trait * Spelling fixes * Expand test for windows FileExt trait to include almost all scenarios * Split three tests out of file_test_windows_fileext_trait() * Remove old versions of those 3 tests * Split remaining file_test_windows_fileext_trait() into case 4, 5 * More test cleanup, always test expected_offset where possible * Test read first for consistency * Use same doctsring examples as seek_read(), seek_write() * Missing period * Oops: actually call _exact(), _all() methods in case 2, 3 * Add missing seek_read_exact_seek_write_all feature flags in doc examples
d80ee2c to
837ce84
Compare
|
@bors r+ |
Rollup of 17 pull requests Successful merges: - #158515 (Make let-else respect macro_rules expr metavariable grouping) - #160028 (Better account for `Self` that might be a typo of `self`) - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor) - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner) - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes) - #162990 (post GH comment on types nominations) - #153662 (Suggest fully qualified path on method name collision) - #154665 (add safety section for mem::zeroed) - #159787 (Prefer ModId in more places) - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription) - #162705 (Trigger "C array" parse error recovery in far fewer cases) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162988 (recover `true` and `false` in type position as `bool`) - #162995 (Constify `impl FromStr for NonZero<T>`) - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics) - #163007 (add Dir::try_clone) - #163039 (Use verbose suggestion for parenthetical `Fn` notation and fully-qualified path on ambiguous assoc item)
Rollup of 17 pull requests Successful merges: - #158515 (Make let-else respect macro_rules expr metavariable grouping) - #160028 (Better account for `Self` that might be a typo of `self`) - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor) - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner) - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes) - #162990 (post GH comment on types nominations) - #153662 (Suggest fully qualified path on method name collision) - #154665 (add safety section for mem::zeroed) - #159787 (Prefer ModId in more places) - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription) - #162705 (Trigger "C array" parse error recovery in far fewer cases) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162988 (recover `true` and `false` in type position as `bool`) - #162995 (Constify `impl FromStr for NonZero<T>`) - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics) - #163007 (add Dir::try_clone) - #163039 (Use verbose suggestion for parenthetical `Fn` notation and fully-qualified path on ambiguous assoc item)
Rollup merge of #162875 - json420:seek_read_exact, r=clarfonthey Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt 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.
View all comments
Tracking issue: #162868
This adds
.seek_read_exact()tostd::os::windows::fs::FileExt, an exact port ofread_exact_at()forstd::os::unix::fs::FileExt.And it adds
.seek_write_all()tostd::os::windows::fs::FileExt, an exact port ofwrite_all_at()forstd::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::FileExttrait itself, covering allseek_read_exact(),seek_write_all()corner cases exceptio::ErrorKind::Interrupted(advise welcome on that one). These tests use mock implementations of the traitsseek_read()andseek_write()methods.No LLMs were used in writing this PR.