@@ -1088,7 +1088,8 @@ impl fmt::Debug for IpAddr {
10881088}
10891089
10901090#[ stable( feature = "ip_from_ip" , since = "1.16.0" ) ]
1091- impl From < Ipv4Addr > for IpAddr {
1091+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1092+ impl const From < Ipv4Addr > for IpAddr {
10921093 /// Copies this address to a new `IpAddr::V4`.
10931094 ///
10941095 /// # Examples
@@ -1110,7 +1111,8 @@ impl From<Ipv4Addr> for IpAddr {
11101111}
11111112
11121113#[ stable( feature = "ip_from_ip" , since = "1.16.0" ) ]
1113- impl From < Ipv6Addr > for IpAddr {
1114+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1115+ impl const From < Ipv6Addr > for IpAddr {
11141116 /// Copies this address to a new `IpAddr::V6`.
11151117 ///
11161118 /// # Examples
@@ -1220,7 +1222,8 @@ impl Ord for Ipv4Addr {
12201222}
12211223
12221224#[ stable( feature = "ip_u32" , since = "1.1.0" ) ]
1223- impl From < Ipv4Addr > for u32 {
1225+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1226+ impl const From < Ipv4Addr > for u32 {
12241227 /// Uses [`Ipv4Addr::to_bits`] to convert an IPv4 address to a host byte order `u32`.
12251228 #[ inline]
12261229 fn from ( ip : Ipv4Addr ) -> u32 {
@@ -1229,7 +1232,8 @@ impl From<Ipv4Addr> for u32 {
12291232}
12301233
12311234#[ stable( feature = "ip_u32" , since = "1.1.0" ) ]
1232- impl From < u32 > for Ipv4Addr {
1235+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1236+ impl const From < u32 > for Ipv4Addr {
12331237 /// Uses [`Ipv4Addr::from_bits`] to convert a host byte order `u32` into an IPv4 address.
12341238 #[ inline]
12351239 fn from ( ip : u32 ) -> Ipv4Addr {
@@ -1238,7 +1242,8 @@ impl From<u32> for Ipv4Addr {
12381242}
12391243
12401244#[ stable( feature = "from_slice_v4" , since = "1.9.0" ) ]
1241- impl From < [ u8 ; 4 ] > for Ipv4Addr {
1245+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1246+ impl const From < [ u8 ; 4 ] > for Ipv4Addr {
12421247 /// Creates an `Ipv4Addr` from a four element byte array.
12431248 ///
12441249 /// # Examples
@@ -1256,7 +1261,8 @@ impl From<[u8; 4]> for Ipv4Addr {
12561261}
12571262
12581263#[ stable( feature = "ip_from_slice" , since = "1.17.0" ) ]
1259- impl From < [ u8 ; 4 ] > for IpAddr {
1264+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
1265+ impl const From < [ u8 ; 4 ] > for IpAddr {
12601266 /// Creates an `IpAddr::V4` from a four element byte array.
12611267 ///
12621268 /// # Examples
@@ -2210,15 +2216,17 @@ impl Ord for Ipv6Addr {
22102216}
22112217
22122218#[ stable( feature = "i128" , since = "1.26.0" ) ]
2213- impl From < Ipv6Addr > for u128 {
2219+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2220+ impl const From < Ipv6Addr > for u128 {
22142221 /// Uses [`Ipv6Addr::to_bits`] to convert an IPv6 address to a host byte order `u128`.
22152222 #[ inline]
22162223 fn from ( ip : Ipv6Addr ) -> u128 {
22172224 ip. to_bits ( )
22182225 }
22192226}
22202227#[ stable( feature = "i128" , since = "1.26.0" ) ]
2221- impl From < u128 > for Ipv6Addr {
2228+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2229+ impl const From < u128 > for Ipv6Addr {
22222230 /// Uses [`Ipv6Addr::from_bits`] to convert a host byte order `u128` to an IPv6 address.
22232231 #[ inline]
22242232 fn from ( ip : u128 ) -> Ipv6Addr {
@@ -2227,7 +2235,8 @@ impl From<u128> for Ipv6Addr {
22272235}
22282236
22292237#[ stable( feature = "ipv6_from_octets" , since = "1.9.0" ) ]
2230- impl From < [ u8 ; 16 ] > for Ipv6Addr {
2238+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2239+ impl const From < [ u8 ; 16 ] > for Ipv6Addr {
22312240 /// Creates an `Ipv6Addr` from a sixteen element byte array.
22322241 ///
22332242 /// # Examples
@@ -2254,7 +2263,8 @@ impl From<[u8; 16]> for Ipv6Addr {
22542263}
22552264
22562265#[ stable( feature = "ipv6_from_segments" , since = "1.16.0" ) ]
2257- impl From < [ u16 ; 8 ] > for Ipv6Addr {
2266+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2267+ impl const From < [ u16 ; 8 ] > for Ipv6Addr {
22582268 /// Creates an `Ipv6Addr` from an eight element 16-bit array.
22592269 ///
22602270 /// # Examples
@@ -2282,7 +2292,8 @@ impl From<[u16; 8]> for Ipv6Addr {
22822292}
22832293
22842294#[ stable( feature = "ip_from_slice" , since = "1.17.0" ) ]
2285- impl From < [ u8 ; 16 ] > for IpAddr {
2295+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2296+ impl const From < [ u8 ; 16 ] > for IpAddr {
22862297 /// Creates an `IpAddr::V6` from a sixteen element byte array.
22872298 ///
22882299 /// # Examples
@@ -2309,7 +2320,8 @@ impl From<[u8; 16]> for IpAddr {
23092320}
23102321
23112322#[ stable( feature = "ip_from_slice" , since = "1.17.0" ) ]
2312- impl From < [ u16 ; 8 ] > for IpAddr {
2323+ #[ rustc_const_unstable( feature = "const_try" , issue = "74935" ) ]
2324+ impl const From < [ u16 ; 8 ] > for IpAddr {
23132325 /// Creates an `IpAddr::V6` from an eight element 16-bit array.
23142326 ///
23152327 /// # Examples
0 commit comments