Skip to content

fd-views: AsRef<File>&Co. for BorrowedFd - #160404

Open
the8472 wants to merge 2 commits into
rust-lang:mainfrom
the8472:fd-views
Open

the8472 wants to merge 2 commits into
rust-lang:mainfrom
the8472:fd-views

Conversation

@the8472

@the8472 the8472 commented Aug 2, 2026 •

Copy link
Copy Markdown
Member

View all comments

tracking issue: #160402

This uses #[unstable_feature_bound] so the trait impls are not insta-stable, so no FCP needed yet. But they're infectious to callers which means we currently can't dogfood the added API in std itself.

@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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 2, 2026
@rustbot rustbot added the O-windows Operating system: Windows label Aug 3, 2026
@the8472
the8472 marked this pull request as ready for review August 3, 2026 22:09
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 3, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 3, 2026
@rustbot

rustbot commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

r? @jhpratt

rustbot has assigned @jhpratt.
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: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 13 candidates
  • Random selection from 6 candidates

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jhpratt

jhpratt commented Aug 5, 2026

Copy link
Copy Markdown
Member

Let me know when CI is passing and I'll take a look.

@jhpratt jhpratt 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 Aug 8, 2026
@rustbot

This comment has been minimized.

@the8472

the8472 commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

@rustbot ready

@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 Oct 5, 2026
@jhpratt

jhpratt commented Oct 17, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 335e8c8 has been approved by jhpratt

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 Oct 17, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Oct 17, 2026
fd-views: AsRef<File>&Co. for BorrowedFd

tracking issue: rust-lang#160402

This uses `#[unstable_feature_bound]` so the trait impls are _not_ insta-stable, so no FCP needed yet. But they're infectious to callers which means we currently can't dogfood the added API in std itself.
rust-bors Bot pushed a commit that referenced this pull request Oct 17, 2026
Rollup of 10 pull requests

Successful merges:

 - #163731 (Add bootstrap step to build the TPDE plugin)
 - #160404 (fd-views: AsRef<File>&Co. for BorrowedFd)
 - #161698 (Fix rmeta-link metadata not being read on AIX)
 - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`)
 - #164424 (diagnostic: skip wrong loops when explaining borrow errors)
 - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.)
 - #163862 (Collect all limit attributes during TyCtxt creation)
 - #164213 (make the safety documentation consistent in task::LocalWaker)
 - #164356 (Add missing full stop)
 - #164374 (core: hint: fix `unlikely`'s example polarity typo)
@rust-bors

rust-bors Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Testing commit 335e8c8 with merge 0e257b5...

Workflow: https://github.com/rust-lang/rust/actions/runs/39019991801

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 20, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 20, 2026
fd-views: AsRef<File>&Co. for BorrowedFd

tracking issue: rust-lang#160402

This uses `#[unstable_feature_bound]` so the trait impls are _not_ insta-stable, so no FCP needed yet. But they're infectious to callers which means we currently can't dogfood the added API in std itself.
rust-bors Bot pushed a commit that referenced this pull request Oct 20, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - #163668 (Remap syntax contexts and expansion ids for det. metadata encoding)
 - #160404 (fd-views: AsRef<File>&Co. for BorrowedFd)
 - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - #163317 (Stop useless caching of post-LTO artifact caching for fat LTO)
 - #163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - #164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - #164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism)
 - #164611 (Improve bit permutation codegen)
 - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`)
 - #162668 (document that `!` does bitwise and logical negation)
 - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - #164509 (layout invariant: turn delayed bug back into proper assertion)
 - #164540 (Minor optimizations around macro parsing)
 - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - #164595 (Allow attributes in function trait parameters)
 - #164641 (Stabilize `slice_split_once`)
 - #164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
@jhpratt

jhpratt commented Oct 21, 2026

Copy link
Copy Markdown
Member

@bors r- #164658 (comment)


---- library/std/src/os/fd/owned.rs - os::fd::owned::BorrowedFd<'_>::to_view (line 96) stdout ----
Test executable failed (exit status: 1).

stderr:
error: unsupported operation: obtaining metadata is only supported on file-backed file descriptors
   --> /checkout/library/std/src/sys/pal/unix/weak/syscall.rs:13:26
    |
 13 |                   unsafe { fun($($param),*) }
    |                            ^^^^^^^^^^^^^^^^ unsupported operation occurred here
    |
   ::: /checkout/library/std/src/sys/fs/unix.rs:166:9
    |
166 | /         syscall!(
167 | |             fn statx(
168 | |                 fd: c_int,
169 | |                 pathname: *const c_char,
...   |
173 | |             ) -> c_int;
174 | |         );
    | |_________- in this macro invocation
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: stack backtrace:
            0: std::sys::fs::unix::try_statx::statx
                at /checkout/library/std/src/sys/pal/unix/weak/syscall.rs:13:26: 13:42
            1: std::sys::fs::unix::try_statx
                at /checkout/library/std/src/sys/fs/unix.rs:182:31: 182:69
            2: std::sys::fs::unix::File::file_attr
                at /checkout/library/std/src/sys/fs/unix.rs:1261:41: 1266:14
            3: std::fs::File::metadata
                at /checkout/library/std/src/fs.rs:1150:9: 1150:31
            4: main::_doctest_main_library_std_src_os_fd_owned_rs_96_0
                at library/std/src/os/fd/owned.rs:9:12: 9:61
            5: main
                at library/std/src/os/fd/owned.rs:13:3: 13:54
            6: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
                at /checkout/library/core/src/ops/function.rs:250:5: 250:71
    = note: this error originates in the macro `syscall` (in Nightly builds, run with -Z macro-backtrace for more info)

@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 Oct 21, 2026
@rust-bors

rust-bors Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

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

View changes since this unapproval

@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Any special-casing of Miri in the standard library requires review.

cc @rust-lang/miri

@rustbot

This comment has been minimized.

Comment thread library/std/src/os/fd/owned.rs
Comment thread library/std/src/os/windows/io/handle.rs Outdated
@rustbot

rustbot commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@the8472

the8472 commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

@rustbot ready
@bors rollup=iffy

@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 Oct 24, 2026
@jhpratt

jhpratt commented Oct 25, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit efbea8e has been approved by jhpratt

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 Oct 25, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 25, 2026
fd-views: AsRef<File>&Co. for BorrowedFd

tracking issue: rust-lang#160402

This uses `#[unstable_feature_bound]` so the trait impls are _not_ insta-stable, so no FCP needed yet. But they're infectious to callers which means we currently can't dogfood the added API in std itself.
rust-bors Bot pushed a commit that referenced this pull request Oct 25, 2026
…uwer

Rollup of 20 pull requests

Successful merges:

 - #160404 (fd-views: AsRef<File>&Co. for BorrowedFd)
 - #161362 ( rustdoc: Correctly handle reexports when --document-private-items is used)
 - #163769 (reborrow: Fix various ICEs related to auto reborrowing of user-space types)
 - #164764 (Test(lib/sync): Fix `test_rwlock_max_readers` for 32bit architectures)
 - #164860 (std::fs: read interrupted by a signal, read_buf_exact_at reports EOF.)
 - #164869 (rustc_codegen_gcc subtree update)
 - #157123 (library: optimize truncate method)
 - #159916 (Optimize `str.escape_default().to_string()`)
 - #163510 (process: Improve the output of `Debug` for `ExitStatus` on Unix)
 - #164508 (ping me for layout invariant changes)
 - #164758 (Update dependency jinja2 to v3.1.6 [SECURITY])
 - #164816 (Take the colon span into account for struct field initializers)
 - #164836 (Add regression test for #162109)
 - #164846 (Remove contradictory inequalities from overflow safety docs)
 - #164857 (Do not checkout Cargo for bootstrap tests)
 - #164868 (Fix skipping library build with `--keep-stage[-std]`)
 - #164872 (cg_llvm: clarify Send / Sync story for modules)
 - #164880 (Add context span showing item that can't be annotated)
 - #164881 (Add FIXME comments to `from_ascii_bytes_radix_impl`)
 - #164884 (Windows: bounds-check the reparse point name in `read_link`)

This branch has not been deployed

No deployments
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 O-windows Operating system: Windows 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