@@ -1089,7 +1089,8 @@ impl fmt::Debug for IpAddr {
1089
1089
}
1090
1090
1091
1091
#[ 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 {
1093
1094
/// Copies this address to a new `IpAddr::V4`.
1094
1095
///
1095
1096
/// # Examples
@@ -1111,7 +1112,8 @@ impl From<Ipv4Addr> for IpAddr {
1111
1112
}
1112
1113
1113
1114
#[ 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 {
1115
1117
/// Copies this address to a new `IpAddr::V6`.
1116
1118
///
1117
1119
/// # Examples
@@ -1221,7 +1223,8 @@ impl Ord for Ipv4Addr {
1221
1223
}
1222
1224
1223
1225
#[ 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 {
1225
1228
/// Uses [`Ipv4Addr::to_bits`] to convert an IPv4 address to a host byte order `u32`.
1226
1229
#[ inline]
1227
1230
fn from ( ip : Ipv4Addr ) -> u32 {
@@ -1230,7 +1233,8 @@ impl From<Ipv4Addr> for u32 {
1230
1233
}
1231
1234
1232
1235
#[ 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 {
1234
1238
/// Uses [`Ipv4Addr::from_bits`] to convert a host byte order `u32` into an IPv4 address.
1235
1239
#[ inline]
1236
1240
fn from ( ip : u32 ) -> Ipv4Addr {
@@ -1239,7 +1243,8 @@ impl From<u32> for Ipv4Addr {
1239
1243
}
1240
1244
1241
1245
#[ 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 {
1243
1248
/// Creates an `Ipv4Addr` from a four element byte array.
1244
1249
///
1245
1250
/// # Examples
@@ -1257,7 +1262,8 @@ impl From<[u8; 4]> for Ipv4Addr {
1257
1262
}
1258
1263
1259
1264
#[ 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 {
1261
1267
/// Creates an `IpAddr::V4` from a four element byte array.
1262
1268
///
1263
1269
/// # Examples
@@ -2211,15 +2217,17 @@ impl Ord for Ipv6Addr {
2211
2217
}
2212
2218
2213
2219
#[ 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 {
2215
2222
/// Uses [`Ipv6Addr::to_bits`] to convert an IPv6 address to a host byte order `u128`.
2216
2223
#[ inline]
2217
2224
fn from ( ip : Ipv6Addr ) -> u128 {
2218
2225
ip. to_bits ( )
2219
2226
}
2220
2227
}
2221
2228
#[ 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 {
2223
2231
/// Uses [`Ipv6Addr::from_bits`] to convert a host byte order `u128` to an IPv6 address.
2224
2232
#[ inline]
2225
2233
fn from ( ip : u128 ) -> Ipv6Addr {
@@ -2228,7 +2236,8 @@ impl From<u128> for Ipv6Addr {
2228
2236
}
2229
2237
2230
2238
#[ 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 {
2232
2241
/// Creates an `Ipv6Addr` from a sixteen element byte array.
2233
2242
///
2234
2243
/// # Examples
@@ -2255,7 +2264,8 @@ impl From<[u8; 16]> for Ipv6Addr {
2255
2264
}
2256
2265
2257
2266
#[ 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 {
2259
2269
/// Creates an `Ipv6Addr` from an eight element 16-bit array.
2260
2270
///
2261
2271
/// # Examples
@@ -2283,7 +2293,8 @@ impl From<[u16; 8]> for Ipv6Addr {
2283
2293
}
2284
2294
2285
2295
#[ 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 {
2287
2298
/// Creates an `IpAddr::V6` from a sixteen element byte array.
2288
2299
///
2289
2300
/// # Examples
@@ -2310,7 +2321,8 @@ impl From<[u8; 16]> for IpAddr {
2310
2321
}
2311
2322
2312
2323
#[ 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 {
2314
2326
/// Creates an `IpAddr::V6` from an eight element 16-bit array.
2315
2327
///
2316
2328
/// # Examples
0 commit comments