rust/library
bors 521734787e Auto merge of #87329 - sunfishcode:sunfishcode/io-safety, r=joshtriplett
I/O safety.

Introduce `OwnedFd` and `BorrowedFd`, and the `AsFd` trait, and
implementations of `AsFd`, `From<OwnedFd>` and `From<T> for OwnedFd`
for relevant types, along with Windows counterparts for handles and
sockets.

Tracking issue: <https://github.com/rust-lang/rust/issues/87074>

RFC: <https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md>

Highlights:
 - The doc comments at the top of library/std/src/os/unix/io/mod.rs and library/std/src/os/windows/io/mod.rs
 - The new types and traits in library/std/src/os/unix/io/fd.rs and library/std/src/os/windows/io/handle.rs
 - The removal of the `RawHandle` struct the Windows impl, which had the same name as the `RawHandle` type alias, and its functionality is now folded into `Handle`.

Managing five levels of wrapping (File wraps sys::fs::File wraps sys::fs::FileDesc wraps OwnedFd wraps RawFd, etc.) made for a fair amount of churn and verbose as/into/from sequences in some places. I've managed to simplify some of them, but I'm open to ideas here.

r? `@joshtriplett`
2021-08-20 11:00:55 +00:00
..
alloc Constified Default implementations 2021-08-17 07:15:54 +00:00
backtrace@4f925f8d81 Update the backtrace crate in libstd 2021-08-19 07:31:49 -07:00
core Rollup merge of #88031 - ibraheemdev:build-hasher-object-safe, r=m-ou-se 2021-08-18 19:54:57 +02:00
panic_abort Use C-unwind ABI for __rust_start_panic in panic_abort 2021-08-05 18:01:17 +08:00
panic_unwind STD support for the ESP-IDF framework 2021-08-10 12:09:00 +03:00
proc_macro Change proc_macro::Diagnostics docs 2021-08-07 23:54:34 +10:00
profiler_builtins rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rtstartup
rustc-std-workspace-alloc rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc-std-workspace-core rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc-std-workspace-std rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
std Auto merge of #87329 - sunfishcode:sunfishcode/io-safety, r=joshtriplett 2021-08-20 11:00:55 +00:00
stdarch@c158cfd38e Update stdarch to deprecate crypto aarch64 target_feature 2021-08-03 12:07:56 +00:00
test rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
unwind STD support for the ESP-IDF framework 2021-08-10 12:09:00 +03:00