diff --git a/library/std/src/os/windows/mod.rs b/library/std/src/os/windows/mod.rs index 507d14765e3fa..47571d99a97c6 100644 --- a/library/std/src/os/windows/mod.rs +++ b/library/std/src/os/windows/mod.rs @@ -30,7 +30,7 @@ pub mod ffi; pub mod fs; pub mod io; -#[unstable(feature = "windows_unix_domain_sockets", issue = "150487")] +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub mod net; pub mod process; pub mod raw; diff --git a/library/std/src/os/windows/net/addr.rs b/library/std/src/os/windows/net/addr.rs index 5f6b93e56e723..9341eae3f6ca1 100644 --- a/library/std/src/os/windows/net/addr.rs +++ b/library/std/src/os/windows/net/addr.rs @@ -1,4 +1,4 @@ -#![unstable(feature = "windows_unix_domain_sockets", issue = "150487")] +#![stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] use crate::byte_str::ByteStr; use crate::ffi::OsStr; use crate::path::Path; @@ -8,7 +8,7 @@ use crate::sys::cvt_nz; use crate::{fmt, io, mem, ptr}; #[cfg(not(doc))] -pub fn sockaddr_un(path: &Path) -> io::Result<(SOCKADDR_UN, usize)> { +pub(super) fn sockaddr_un(path: &Path) -> io::Result<(SOCKADDR_UN, usize)> { // SAFETY: All zeros is a valid representation for `sockaddr_un`. let mut addr: SOCKADDR_UN = unsafe { mem::zeroed() }; addr.sun_family = AF_UNIX; @@ -34,11 +34,13 @@ pub fn sockaddr_un(path: &Path) -> io::Result<(SOCKADDR_UN, usize)> { } #[cfg(not(doc))] const SUN_PATH_OFFSET: usize = mem::offset_of!(SOCKADDR_UN, sun_path); +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub struct SocketAddr { #[cfg(not(doc))] pub(super) addr: SOCKADDR_UN, pub(super) len: u32, // Use u32 here as same as libc::socklen_t } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl fmt::Debug for SocketAddr { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { match self.address() { @@ -81,7 +83,6 @@ impl SocketAddr { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// use std::path::Path; /// @@ -92,6 +93,7 @@ impl SocketAddr { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn as_pathname(&self) -> Option<&Path> { if let AddressKind::Pathname(path) = self.address() { Some(path) } else { None } } @@ -107,7 +109,6 @@ impl SocketAddr { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::SocketAddr; /// use std::path::Path; /// @@ -122,11 +123,11 @@ impl SocketAddr { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::SocketAddr; /// /// assert!(SocketAddr::from_pathname("/path/with/\0/bytes").is_err()); /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn from_pathname

(path: P) -> io::Result where P: AsRef, @@ -156,7 +157,6 @@ impl SocketAddr { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -166,6 +166,7 @@ impl SocketAddr { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn is_unnamed(&self) -> bool { matches!(self.address(), AddressKind::Unnamed) } diff --git a/library/std/src/os/windows/net/listener.rs b/library/std/src/os/windows/net/listener.rs index 19f5254e08bf9..821d0dc555b0e 100644 --- a/library/std/src/os/windows/net/listener.rs +++ b/library/std/src/os/windows/net/listener.rs @@ -1,4 +1,4 @@ -#![unstable(feature = "windows_unix_domain_sockets", issue = "150487")] +#![stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] use crate::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket}; use crate::os::windows::net::{SocketAddr, UnixStream}; use crate::path::Path; @@ -18,7 +18,6 @@ use crate::{fmt, io}; /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] -/// #![feature(windows_unix_domain_sockets)] /// use std::thread; /// use std::os::windows::net::{UnixStream, UnixListener}; /// @@ -45,8 +44,10 @@ use crate::{fmt, io}; /// Ok(()) /// } /// ``` +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub struct UnixListener(Socket); +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl fmt::Debug for UnixListener { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let mut builder = fmt.debug_struct("UnixListener"); @@ -64,7 +65,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// let listener = match UnixListener::bind("/path/to/the/socket") { @@ -75,6 +75,7 @@ impl UnixListener { /// } /// }; /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn bind>(path: P) -> io::Result { let socket_addr = SocketAddr::from_pathname(path)?; Self::bind_addr(&socket_addr) @@ -88,7 +89,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::{UnixListener}; /// /// fn main() -> std::io::Result<()> { @@ -105,6 +105,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn bind_addr(socket_addr: &SocketAddr) -> io::Result { startup(); let inner = Socket::new(AF_UNIX as _, SOCK_STREAM)?; @@ -127,7 +128,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -140,6 +140,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn accept(&self) -> io::Result<(UnixStream, SocketAddr)> { let mut storage = SOCKADDR_UN::default(); let mut len = size_of::() as _; @@ -154,7 +155,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -163,6 +163,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn local_addr(&self) -> io::Result { SocketAddr::new(|addr, len| unsafe { getsockname(self.0.as_raw(), addr, len) }) } @@ -177,7 +178,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -186,6 +186,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn try_clone(&self) -> io::Result { self.0.duplicate().map(UnixListener) } @@ -202,7 +203,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -211,6 +211,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { self.0.set_nonblocking(nonblocking) } @@ -221,7 +222,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -233,6 +233,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn take_error(&self) -> io::Result> { self.0.take_error() } @@ -246,7 +247,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::thread; /// use std::os::windows::net::{UnixStream, UnixListener}; /// @@ -270,6 +270,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn incoming(&self) -> Incoming<'_> { Incoming { listener: self } } @@ -283,7 +284,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] -/// #![feature(windows_unix_domain_sockets)] /// use std::thread; /// use std::os::windows::net::{UnixStream, UnixListener}; /// @@ -307,10 +307,12 @@ impl UnixListener { /// Ok(()) /// } /// ``` +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub struct Incoming<'a> { listener: &'a UnixListener, } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl<'a> Iterator for Incoming<'a> { type Item = io::Result; @@ -323,6 +325,7 @@ impl<'a> Iterator for Incoming<'a> { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl AsRawSocket for UnixListener { #[inline] fn as_raw_socket(&self) -> RawSocket { @@ -330,6 +333,7 @@ impl AsRawSocket for UnixListener { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl FromRawSocket for UnixListener { #[inline] unsafe fn from_raw_socket(sock: RawSocket) -> Self { @@ -337,6 +341,7 @@ impl FromRawSocket for UnixListener { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl IntoRawSocket for UnixListener { #[inline] fn into_raw_socket(self) -> RawSocket { @@ -344,6 +349,7 @@ impl IntoRawSocket for UnixListener { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl<'a> IntoIterator for &'a UnixListener { type Item = io::Result; type IntoIter = Incoming<'a>; diff --git a/library/std/src/os/windows/net/mod.rs b/library/std/src/os/windows/net/mod.rs index 6b3f062b8ab41..8d3b99368f969 100644 --- a/library/std/src/os/windows/net/mod.rs +++ b/library/std/src/os/windows/net/mod.rs @@ -1,6 +1,9 @@ mod addr; mod listener; mod stream; +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub use addr::*; +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub use listener::*; +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub use stream::*; diff --git a/library/std/src/os/windows/net/stream.rs b/library/std/src/os/windows/net/stream.rs index c0f32e75411e9..b23b21832c32c 100644 --- a/library/std/src/os/windows/net/stream.rs +++ b/library/std/src/os/windows/net/stream.rs @@ -1,4 +1,4 @@ -#![unstable(feature = "windows_unix_domain_sockets", issue = "150487")] +#![stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] use crate::net::Shutdown; use crate::os::windows::io::{ AsRawSocket, AsSocket, BorrowedSocket, FromRawSocket, IntoRawSocket, RawSocket, @@ -23,7 +23,6 @@ use crate::{fmt, io}; /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] -/// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::io::prelude::*; /// @@ -36,7 +35,9 @@ use crate::{fmt, io}; /// Ok(()) /// } /// ``` +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub struct UnixStream(pub(super) Socket); +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl fmt::Debug for UnixStream { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let mut builder = fmt.debug_struct("UnixStream"); @@ -57,7 +58,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// let socket = match UnixStream::connect("/tmp/sock") { @@ -68,6 +68,7 @@ impl UnixStream { /// } /// }; /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn connect>(path: P) -> io::Result { let socket_addr = SocketAddr::from_pathname(path)?; Self::connect_addr(&socket_addr) @@ -81,7 +82,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::{UnixListener, UnixStream}; /// /// fn main() -> std::io::Result<()> { @@ -98,6 +98,7 @@ impl UnixStream { /// Ok(()) /// } /// ```` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn connect_addr(socket_addr: &SocketAddr) -> io::Result { startup(); let inner = Socket::new(AF_UNIX as _, SOCK_STREAM)?; @@ -117,7 +118,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// fn main() -> std::io::Result<()> { @@ -126,6 +126,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn local_addr(&self) -> io::Result { SocketAddr::new(|addr, len| unsafe { getsockname(self.0.as_raw(), addr, len) }) } @@ -136,7 +137,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// fn main() -> std::io::Result<()> { @@ -145,6 +145,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn peer_addr(&self) -> io::Result { SocketAddr::new(|addr, len| unsafe { getpeername(self.0.as_raw(), addr, len) }) } @@ -155,7 +156,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::time::Duration; /// @@ -166,6 +166,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn read_timeout(&self) -> io::Result> { self.0.timeout(SO_RCVTIMEO) } @@ -176,7 +177,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// fn main() -> std::io::Result<()> { @@ -185,6 +185,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { self.0.set_nonblocking(nonblocking) } @@ -201,7 +202,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::time::Duration; /// @@ -217,7 +217,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::io; /// use std::os::windows::net::UnixStream; /// use std::time::Duration; @@ -230,6 +229,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn set_read_timeout(&self, dur: Option) -> io::Result<()> { self.0.set_timeout(dur, SO_RCVTIMEO) } @@ -246,7 +246,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::time::Duration; /// @@ -263,7 +262,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::io; /// use std::os::windows::net::UnixStream; /// use std::time::Duration; @@ -276,6 +274,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn set_write_timeout(&self, dur: Option) -> io::Result<()> { self.0.set_timeout(dur, SO_SNDTIMEO) } @@ -290,7 +289,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::net::Shutdown; /// @@ -300,6 +298,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn shutdown(&self, how: Shutdown) -> io::Result<()> { self.0.shutdown(how) } @@ -310,7 +309,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// fn main() -> std::io::Result<()> { @@ -321,6 +319,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn take_error(&self) -> io::Result> { self.0.take_error() } @@ -336,7 +335,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// fn main() -> std::io::Result<()> { @@ -345,6 +343,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn try_clone(&self) -> io::Result { self.0.duplicate().map(UnixStream) } @@ -355,7 +354,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::time::Duration; /// @@ -367,23 +365,27 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn write_timeout(&self) -> io::Result> { self.0.timeout(SO_SNDTIMEO) } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl io::Read for UnixStream { fn read(&mut self, buf: &mut [u8]) -> io::Result { io::Read::read(&mut &*self, buf) } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl<'a> io::Read for &'a UnixStream { fn read(&mut self, buf: &mut [u8]) -> io::Result { self.0.read(buf) } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl io::Write for UnixStream { fn write(&mut self, buf: &[u8]) -> io::Result { io::Write::write(&mut &*self, buf) @@ -393,6 +395,7 @@ impl io::Write for UnixStream { io::Write::flush(&mut &*self) } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl<'a> io::Write for &'a UnixStream { fn write(&mut self, buf: &[u8]) -> io::Result { self.write_vectored(&[io::IoSlice::new(buf)]) @@ -410,6 +413,7 @@ impl<'a> io::Write for &'a UnixStream { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl AsSocket for UnixStream { #[inline] fn as_socket(&self) -> BorrowedSocket<'_> { @@ -417,6 +421,7 @@ impl AsSocket for UnixStream { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl AsRawSocket for UnixStream { #[inline] fn as_raw_socket(&self) -> RawSocket { @@ -424,6 +429,7 @@ impl AsRawSocket for UnixStream { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl FromRawSocket for UnixStream { #[inline] unsafe fn from_raw_socket(sock: RawSocket) -> Self { @@ -431,6 +437,7 @@ impl FromRawSocket for UnixStream { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl IntoRawSocket for UnixStream { fn into_raw_socket(self) -> RawSocket { self.0.into_raw_socket() diff --git a/library/std/tests/windows_unix_socket.rs b/library/std/tests/windows_unix_socket.rs index dd71b1f135dce..9a240b27635fd 100644 --- a/library/std/tests/windows_unix_socket.rs +++ b/library/std/tests/windows_unix_socket.rs @@ -1,6 +1,5 @@ #![cfg(windows)] #![cfg(not(miri))] // no Windows socket support in Miri -#![feature(windows_unix_domain_sockets)] // Now only test windows_unix_domain_sockets feature // in the future, will test both unix and windows uds use std::io::{Read, Write};