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