]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Auto merge of #96232 - sunfishcode:sunfishcode/io-safety-const-fns, r=joshtriplett
authorbors <bors@rust-lang.org>
Tue, 10 May 2022 21:19:19 +0000 (21:19 +0000)
committerbors <bors@rust-lang.org>
Tue, 10 May 2022 21:19:19 +0000 (21:19 +0000)
commitecd44958e0a21110d09862ee080d95a4ca6c52f8
tree1d0753e68c2f53caf577f675009481734af93bd3
parentfee75fbe11b1fad5d93c723234178b2a329a3c03
parent0a1ce8277c0a8d7eed7a7d0a62ce0adcba342572
Auto merge of #96232 - sunfishcode:sunfishcode/io-safety-const-fns, r=joshtriplett

Make `BorrowedFd::borrow_raw` a const fn.

Making `BorrowedFd::borrow_raw` a const fn allows it to be used to
create a constant `BorrowedFd<'static>` holding constants such as
`AT_FDCWD`. This will allow [`rustix::fs::cwd`] to become a const fn.

For consistency, make similar changes to `BorrowedHandle::borrow_raw`
and `BorrowedSocket::borrow_raw`.

[`rustix::fs::cwd`]: https://docs.rs/rustix/latest/rustix/fs/fn.cwd.html

r? `@joshtriplett`
library/std/src/os/windows/io/handle.rs