@@ -1089,7 +1089,8 @@ impl fmt::Debug for IpAddr {
10891089}
10901090
10911091#[ stable( feature = "ip_from_ip" , since = "1.16.0" ) ]
1092- impl From < Ipv4Addr > for IpAddr {
1092+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1093+ impl const From < Ipv4Addr > for IpAddr {
10931094 /// Copies this address to a new `IpAddr::V4`.
10941095 ///
10951096 /// # Examples
@@ -1111,7 +1112,8 @@ impl From<Ipv4Addr> for IpAddr {
11111112}
11121113
11131114#[ stable( feature = "ip_from_ip" , since = "1.16.0" ) ]
1114- impl From < Ipv6Addr > for IpAddr {
1115+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1116+ impl const From < Ipv6Addr > for IpAddr {
11151117 /// Copies this address to a new `IpAddr::V6`.
11161118 ///
11171119 /// # Examples
@@ -1221,7 +1223,8 @@ impl Ord for Ipv4Addr {
12211223}
12221224
12231225#[ stable( feature = "ip_u32" , since = "1.1.0" ) ]
1224- impl From < Ipv4Addr > for u32 {
1226+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1227+ impl const From < Ipv4Addr > for u32 {
12251228 /// Uses [`Ipv4Addr::to_bits`] to convert an IPv4 address to a host byte order `u32`.
12261229 #[ inline]
12271230 fn from ( ip : Ipv4Addr ) -> u32 {
@@ -1230,7 +1233,8 @@ impl From<Ipv4Addr> for u32 {
12301233}
12311234
12321235#[ stable( feature = "ip_u32" , since = "1.1.0" ) ]
1233- impl From < u32 > for Ipv4Addr {
1236+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1237+ impl const From < u32 > for Ipv4Addr {
12341238 /// Uses [`Ipv4Addr::from_bits`] to convert a host byte order `u32` into an IPv4 address.
12351239 #[ inline]
12361240 fn from ( ip : u32 ) -> Ipv4Addr {
@@ -1239,7 +1243,8 @@ impl From<u32> for Ipv4Addr {
12391243}
12401244
12411245#[ stable( feature = "from_slice_v4" , since = "1.9.0" ) ]
1242- impl From < [ u8 ; 4 ] > for Ipv4Addr {
1246+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1247+ impl const From < [ u8 ; 4 ] > for Ipv4Addr {
12431248 /// Creates an `Ipv4Addr` from a four element byte array.
12441249 ///
12451250 /// # Examples
@@ -1257,7 +1262,8 @@ impl From<[u8; 4]> for Ipv4Addr {
12571262}
12581263
12591264#[ stable( feature = "ip_from_slice" , since = "1.17.0" ) ]
1260- impl From < [ u8 ; 4 ] > for IpAddr {
1265+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1266+ impl const From < [ u8 ; 4 ] > for IpAddr {
12611267 /// Creates an `IpAddr::V4` from a four element byte array.
12621268 ///
12631269 /// # Examples
@@ -2211,15 +2217,17 @@ impl Ord for Ipv6Addr {
22112217}
22122218
22132219#[ stable( feature = "i128" , since = "1.26.0" ) ]
2214- impl From < Ipv6Addr > for u128 {
2220+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2221+ impl const From < Ipv6Addr > for u128 {
22152222 /// Uses [`Ipv6Addr::to_bits`] to convert an IPv6 address to a host byte order `u128`.
22162223 #[ inline]
22172224 fn from ( ip : Ipv6Addr ) -> u128 {
22182225 ip. to_bits ( )
22192226 }
22202227}
22212228#[ stable( feature = "i128" , since = "1.26.0" ) ]
2222- impl From < u128 > for Ipv6Addr {
2229+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2230+ impl const From < u128 > for Ipv6Addr {
22232231 /// Uses [`Ipv6Addr::from_bits`] to convert a host byte order `u128` to an IPv6 address.
22242232 #[ inline]
22252233 fn from ( ip : u128 ) -> Ipv6Addr {
@@ -2228,7 +2236,8 @@ impl From<u128> for Ipv6Addr {
22282236}
22292237
22302238#[ stable( feature = "ipv6_from_octets" , since = "1.9.0" ) ]
2231- impl From < [ u8 ; 16 ] > for Ipv6Addr {
2239+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2240+ impl const From < [ u8 ; 16 ] > for Ipv6Addr {
22322241 /// Creates an `Ipv6Addr` from a sixteen element byte array.
22332242 ///
22342243 /// # Examples
@@ -2255,7 +2264,8 @@ impl From<[u8; 16]> for Ipv6Addr {
22552264}
22562265
22572266#[ stable( feature = "ipv6_from_segments" , since = "1.16.0" ) ]
2258- impl From < [ u16 ; 8 ] > for Ipv6Addr {
2267+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2268+ impl const From < [ u16 ; 8 ] > for Ipv6Addr {
22592269 /// Creates an `Ipv6Addr` from an eight element 16-bit array.
22602270 ///
22612271 /// # Examples
@@ -2283,7 +2293,8 @@ impl From<[u16; 8]> for Ipv6Addr {
22832293}
22842294
22852295#[ stable( feature = "ip_from_slice" , since = "1.17.0" ) ]
2286- impl From < [ u8 ; 16 ] > for IpAddr {
2296+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2297+ impl const From < [ u8 ; 16 ] > for IpAddr {
22872298 /// Creates an `IpAddr::V6` from a sixteen element byte array.
22882299 ///
22892300 /// # Examples
@@ -2310,7 +2321,8 @@ impl From<[u8; 16]> for IpAddr {
23102321}
23112322
23122323#[ stable( feature = "ip_from_slice" , since = "1.17.0" ) ]
2313- impl From < [ u16 ; 8 ] > for IpAddr {
2324+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2325+ impl const From < [ u16 ; 8 ] > for IpAddr {
23142326 /// Creates an `IpAddr::V6` from an eight element 16-bit array.
23152327 ///
23162328 /// # Examples
0 commit comments