Skip to content

Commit b2b7b40

Browse files
author
Marco Conte
committed
mark with SocketAddr::new, SocketAddrV4::new and SocketAddrV6::new rustc_const_unstable attribute
1 parent dad56f4 commit b2b7b40

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libstd/net/addr.rs

+3
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ impl SocketAddr {
125125
/// assert_eq!(socket.port(), 8080);
126126
/// ```
127127
#[stable(feature = "ip_addr", since = "1.7.0")]
128+
#[rustc_const_unstable(feature = "const_socket_new", issue = "67390")]
128129
pub const fn new(ip: IpAddr, port: u16) -> SocketAddr {
129130
match ip {
130131
IpAddr::V4(a) => SocketAddr::V4(SocketAddrV4::new(a, port)),
@@ -272,6 +273,7 @@ impl SocketAddrV4 {
272273
/// let socket = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080);
273274
/// ```
274275
#[stable(feature = "rust1", since = "1.0.0")]
276+
#[rustc_const_unstable(feature = "const_socket_new", issue = "67390")]
275277
pub const fn new(ip: Ipv4Addr, port: u16) -> SocketAddrV4 {
276278
SocketAddrV4 {
277279
inner: c::sockaddr_in {
@@ -364,6 +366,7 @@ impl SocketAddrV6 {
364366
/// let socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 0);
365367
/// ```
366368
#[stable(feature = "rust1", since = "1.0.0")]
369+
#[rustc_const_unstable(feature = "const_socket_new", issue = "67390")]
367370
pub const fn new(ip: Ipv6Addr, port: u16, flowinfo: u32, scope_id: u32) -> SocketAddrV6 {
368371
SocketAddrV6 {
369372
inner: c::sockaddr_in6 {

0 commit comments

Comments
 (0)