From 5363f350887b1e5b5dd21a86f88c8af9d7fea6da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:25 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/io-lifetimes/src/lib.rs | 56 +++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 25 deletions(-) (limited to 'vendor/io-lifetimes/src/lib.rs') diff --git a/vendor/io-lifetimes/src/lib.rs b/vendor/io-lifetimes/src/lib.rs index 5e2a9d19f..da5e740cf 100644 --- a/vendor/io-lifetimes/src/lib.rs +++ b/vendor/io-lifetimes/src/lib.rs @@ -28,47 +28,47 @@ //! [from+into conversions]: FromFilelike::from_into_filelike #![deny(missing_docs)] -#![cfg_attr(rustc_attrs, feature(rustc_attrs))] -#![cfg_attr(all(io_lifetimes_use_std, target_os = "wasi"), feature(wasi_ext))] -#![cfg_attr(io_lifetimes_use_std, feature(io_safety))] +// Work around https://github.com/rust-lang/rust/issues/103306. +#![cfg_attr(all(wasi_ext, target_os = "wasi"), feature(wasi_ext))] mod portability; mod traits; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] mod types; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] mod impls_std; -mod impls_std_views; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(any(unix, target_os = "wasi"))] pub use traits::AsFd; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] pub use traits::{AsHandle, AsSocket}; #[cfg(any(unix, target_os = "wasi"))] +#[allow(deprecated)] pub use traits::{FromFd, IntoFd}; #[cfg(windows)] +#[allow(deprecated)] pub use traits::{FromHandle, FromSocket, IntoHandle, IntoSocket}; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(any(unix, target_os = "wasi"))] pub use types::{BorrowedFd, OwnedFd}; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] pub use types::{ BorrowedHandle, BorrowedSocket, HandleOrInvalid, InvalidHandleError, NullHandleError, OwnedHandle, OwnedSocket, }; -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(unix)] pub use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd}; -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(target_os = "wasi")] pub use std::os::wasi::io::{AsFd, BorrowedFd, OwnedFd}; -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(windows)] pub use std::os::windows::io::{ AsHandle, AsSocket, BorrowedHandle, BorrowedSocket, HandleOrInvalid, InvalidHandleError, @@ -86,16 +86,18 @@ pub use std::os::windows::io::{ // // So we define `FromFd`/`IntoFd` traits, and implement them in terms of // `From`/`Into`, -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(any(unix, target_os = "wasi"))] +#[allow(deprecated)] impl> FromFd for T { #[inline] fn from_fd(owned_fd: OwnedFd) -> Self { owned_fd.into() } } -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(any(unix, target_os = "wasi"))] +#[allow(deprecated)] impl IntoFd for T where OwnedFd: From, @@ -106,16 +108,18 @@ where } } -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(windows)] +#[allow(deprecated)] impl> FromHandle for T { #[inline] fn from_handle(owned_handle: OwnedHandle) -> Self { owned_handle.into() } } -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(windows)] +#[allow(deprecated)] impl IntoHandle for T where OwnedHandle: From, @@ -126,16 +130,18 @@ where } } -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(windows)] +#[allow(deprecated)] impl> FromSocket for T { #[inline] fn from_socket(owned_socket: OwnedSocket) -> Self { owned_socket.into() } } -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(windows)] +#[allow(deprecated)] impl IntoSocket for T where OwnedSocket: From, @@ -158,22 +164,22 @@ pub mod views; // Ideally, we'd want crates to implement our traits themselves. But for now, // while we're prototyping, we provide a few impls on foreign types. -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "async-std")] mod impls_async_std; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "fs-err")] mod impls_fs_err; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "mio")] mod impls_mio; #[cfg(not(target_os = "wasi"))] -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "os_pipe")] mod impls_os_pipe; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "socket2")] mod impls_socket2; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "tokio")] mod impls_tokio; -- cgit v1.2.3