summaryrefslogtreecommitdiffstats
path: root/vendor/io-lifetimes/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:25 +0000
commit5363f350887b1e5b5dd21a86f88c8af9d7fea6da (patch)
tree35ca005eb6e0e9a1ba3bb5dbc033209ad445dc17 /vendor/io-lifetimes/src/lib.rs
parentAdding debian version 1.66.0+dfsg1-1. (diff)
downloadrustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.tar.xz
rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.zip
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/io-lifetimes/src/lib.rs')
-rw-r--r--vendor/io-lifetimes/src/lib.rs56
1 files changed, 31 insertions, 25 deletions
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<T: From<OwnedFd>> 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<T> IntoFd for T
where
OwnedFd: From<T>,
@@ -106,16 +108,18 @@ where
}
}
-#[cfg(io_lifetimes_use_std)]
+#[cfg(io_safety_is_in_std)]
#[cfg(windows)]
+#[allow(deprecated)]
impl<T: From<OwnedHandle>> 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<T> IntoHandle for T
where
OwnedHandle: From<T>,
@@ -126,16 +130,18 @@ where
}
}
-#[cfg(io_lifetimes_use_std)]
+#[cfg(io_safety_is_in_std)]
#[cfg(windows)]
+#[allow(deprecated)]
impl<T: From<OwnedSocket>> 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<T> IntoSocket for T
where
OwnedSocket: From<T>,
@@ -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;