@@ -1088,7 +1088,8 @@ impl fmt::Debug for IpAddr {
1088
1088
}
1089
1089
1090
1090
#[ 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 {
1092
1093
/// Copies this address to a new `IpAddr::V4`.
1093
1094
///
1094
1095
/// # Examples
@@ -1110,7 +1111,8 @@ impl From<Ipv4Addr> for IpAddr {
1110
1111
}
1111
1112
1112
1113
#[ 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 {
1114
1116
/// Copies this address to a new `IpAddr::V6`.
1115
1117
///
1116
1118
/// # Examples
@@ -1220,7 +1222,8 @@ impl Ord for Ipv4Addr {
1220
1222
}
1221
1223
1222
1224
#[ 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 {
1224
1227
/// Uses [`Ipv4Addr::to_bits`] to convert an IPv4 address to a host byte order `u32`.
1225
1228
#[ inline]
1226
1229
fn from ( ip : Ipv4Addr ) -> u32 {
@@ -1229,7 +1232,8 @@ impl From<Ipv4Addr> for u32 {
1229
1232
}
1230
1233
1231
1234
#[ 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 {
1233
1237
/// Uses [`Ipv4Addr::from_bits`] to convert a host byte order `u32` into an IPv4 address.
1234
1238
#[ inline]
1235
1239
fn from ( ip : u32 ) -> Ipv4Addr {
@@ -1238,7 +1242,8 @@ impl From<u32> for Ipv4Addr {
1238
1242
}
1239
1243
1240
1244
#[ 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 {
1242
1247
/// Creates an `Ipv4Addr` from a four element byte array.
1243
1248
///
1244
1249
/// # Examples
@@ -1256,7 +1261,8 @@ impl From<[u8; 4]> for Ipv4Addr {
1256
1261
}
1257
1262
1258
1263
#[ 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 {
1260
1266
/// Creates an `IpAddr::V4` from a four element byte array.
1261
1267
///
1262
1268
/// # Examples
@@ -2210,15 +2216,17 @@ impl Ord for Ipv6Addr {
2210
2216
}
2211
2217
2212
2218
#[ 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 {
2214
2221
/// Uses [`Ipv6Addr::to_bits`] to convert an IPv6 address to a host byte order `u128`.
2215
2222
#[ inline]
2216
2223
fn from ( ip : Ipv6Addr ) -> u128 {
2217
2224
ip. to_bits ( )
2218
2225
}
2219
2226
}
2220
2227
#[ 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 {
2222
2230
/// Uses [`Ipv6Addr::from_bits`] to convert a host byte order `u128` to an IPv6 address.
2223
2231
#[ inline]
2224
2232
fn from ( ip : u128 ) -> Ipv6Addr {
@@ -2227,7 +2235,8 @@ impl From<u128> for Ipv6Addr {
2227
2235
}
2228
2236
2229
2237
#[ 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 {
2231
2240
/// Creates an `Ipv6Addr` from a sixteen element byte array.
2232
2241
///
2233
2242
/// # Examples
@@ -2254,7 +2263,8 @@ impl From<[u8; 16]> for Ipv6Addr {
2254
2263
}
2255
2264
2256
2265
#[ 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 {
2258
2268
/// Creates an `Ipv6Addr` from an eight element 16-bit array.
2259
2269
///
2260
2270
/// # Examples
@@ -2282,7 +2292,8 @@ impl From<[u16; 8]> for Ipv6Addr {
2282
2292
}
2283
2293
2284
2294
#[ 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 {
2286
2297
/// Creates an `IpAddr::V6` from a sixteen element byte array.
2287
2298
///
2288
2299
/// # Examples
@@ -2309,7 +2320,8 @@ impl From<[u8; 16]> for IpAddr {
2309
2320
}
2310
2321
2311
2322
#[ 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 {
2313
2325
/// Creates an `IpAddr::V6` from an eight element 16-bit array.
2314
2326
///
2315
2327
/// # Examples
0 commit comments