about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-11 03:32:03 +0100
committerGitHub <noreply@github.com>2022-03-11 03:32:03 +0100
commitab851653a5ae4803bb1b498e83484d2588a8ee1d (patch)
treead43e3532589cfc6b52fc5a5cdf7154f6ea8bba9 /library/std/src
parentd58c69ae96c8d936a9074e9c706036242e895d9b (diff)
parenta84e77bebff4b3a0ab30108d720b47ddb6d027df (diff)
downloadrust-ab851653a5ae4803bb1b498e83484d2588a8ee1d.tar.gz
rust-ab851653a5ae4803bb1b498e83484d2588a8ee1d.zip
Rollup merge of #94356 - Thomasdezeeuw:stabilize_unix_socket_creation, r=dtolnay
Rename unix::net::SocketAddr::from_path to from_pathname and stabilize it

Stabilizes `unix_socket_creation`.

Closes https://github.com/rust-lang/rust/issues/93423
r? `@m-ou-se`
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/os/unix/net/addr.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/library/std/src/os/unix/net/addr.rs b/library/std/src/os/unix/net/addr.rs
index ba65d8f285e..a3ef4b2d92c 100644
--- a/library/std/src/os/unix/net/addr.rs
+++ b/library/std/src/os/unix/net/addr.rs
@@ -140,12 +140,11 @@ impl SocketAddr {
     /// # Examples
     ///
     /// ```
-    /// #![feature(unix_socket_creation)]
     /// use std::os::unix::net::SocketAddr;
     /// use std::path::Path;
     ///
     /// # fn main() -> std::io::Result<()> {
-    /// let address = SocketAddr::from_path("/path/to/socket")?;
+    /// let address = SocketAddr::from_pathname("/path/to/socket")?;
     /// assert_eq!(address.as_pathname(), Some(Path::new("/path/to/socket")));
     /// # Ok(())
     /// # }
@@ -154,13 +153,12 @@ impl SocketAddr {
     /// Creating a `SocketAddr` with a NULL byte results in an error.
     ///
     /// ```
-    /// #![feature(unix_socket_creation)]
     /// use std::os::unix::net::SocketAddr;
     ///
-    /// assert!(SocketAddr::from_path("/path/with/\0/bytes").is_err());
+    /// assert!(SocketAddr::from_pathname("/path/with/\0/bytes").is_err());
     /// ```
-    #[unstable(feature = "unix_socket_creation", issue = "93423")]
-    pub fn from_path<P>(path: P) -> io::Result<SocketAddr>
+    #[stable(feature = "unix_socket_creation", since = "1.61.0")]
+    pub fn from_pathname<P>(path: P) -> io::Result<SocketAddr>
     where
         P: AsRef<Path>,
     {