@@ -1184,12 +1184,7 @@ pub const fn min<T: ~const Ord + ~const Destruct>(v1: T, v2: T) -> T {
1184
1184
#[ inline]
1185
1185
#[ must_use]
1186
1186
#[ stable( feature = "cmp_min_max_by" , since = "1.53.0" ) ]
1187
- #[ rustc_const_unstable( feature = "const_cmp" , issue = "92391" ) ]
1188
- pub const fn min_by < T , F : ~const FnOnce ( & T , & T ) -> Ordering > ( v1 : T , v2 : T , compare : F ) -> T
1189
- where
1190
- T : ~const Destruct ,
1191
- F : ~const Destruct ,
1192
- {
1187
+ pub fn min_by < T , F : FnOnce ( & T , & T ) -> Ordering > ( v1 : T , v2 : T , compare : F ) -> T {
1193
1188
match compare ( & v1, & v2) {
1194
1189
Ordering :: Less | Ordering :: Equal => v1,
1195
1190
Ordering :: Greater => v2,
@@ -1211,14 +1206,8 @@ where
1211
1206
#[ inline]
1212
1207
#[ must_use]
1213
1208
#[ stable( feature = "cmp_min_max_by" , since = "1.53.0" ) ]
1214
- #[ rustc_const_unstable( feature = "const_cmp" , issue = "92391" ) ]
1215
- pub const fn min_by_key < T , F : ~const FnMut ( & T ) -> K , K : ~const Ord > ( v1 : T , v2 : T , mut f : F ) -> T
1216
- where
1217
- T : ~const Destruct ,
1218
- F : ~const Destruct ,
1219
- K : ~const Destruct ,
1220
- {
1221
- min_by ( v1, v2, const |v1, v2| f ( v1) . cmp ( & f ( v2) ) )
1209
+ pub fn min_by_key < T , F : FnMut ( & T ) -> K , K : Ord > ( v1 : T , v2 : T , mut f : F ) -> T {
1210
+ min_by ( v1, v2, |v1, v2| f ( v1) . cmp ( & f ( v2) ) )
1222
1211
}
1223
1212
1224
1213
/// Compares and returns the maximum of two values.
@@ -1259,12 +1248,7 @@ pub const fn max<T: ~const Ord + ~const Destruct>(v1: T, v2: T) -> T {
1259
1248
#[ inline]
1260
1249
#[ must_use]
1261
1250
#[ stable( feature = "cmp_min_max_by" , since = "1.53.0" ) ]
1262
- #[ rustc_const_unstable( feature = "const_cmp" , issue = "92391" ) ]
1263
- pub const fn max_by < T , F : ~const FnOnce ( & T , & T ) -> Ordering > ( v1 : T , v2 : T , compare : F ) -> T
1264
- where
1265
- T : ~const Destruct ,
1266
- F : ~const Destruct ,
1267
- {
1251
+ pub fn max_by < T , F : FnOnce ( & T , & T ) -> Ordering > ( v1 : T , v2 : T , compare : F ) -> T {
1268
1252
match compare ( & v1, & v2) {
1269
1253
Ordering :: Less | Ordering :: Equal => v2,
1270
1254
Ordering :: Greater => v1,
@@ -1286,14 +1270,8 @@ where
1286
1270
#[ inline]
1287
1271
#[ must_use]
1288
1272
#[ stable( feature = "cmp_min_max_by" , since = "1.53.0" ) ]
1289
- #[ rustc_const_unstable( feature = "const_cmp" , issue = "92391" ) ]
1290
- pub const fn max_by_key < T , F : ~const FnMut ( & T ) -> K , K : ~const Ord > ( v1 : T , v2 : T , mut f : F ) -> T
1291
- where
1292
- T : ~const Destruct ,
1293
- F : ~const Destruct ,
1294
- K : ~const Destruct ,
1295
- {
1296
- max_by ( v1, v2, const |v1, v2| f ( v1) . cmp ( & f ( v2) ) )
1273
+ pub fn max_by_key < T , F : FnMut ( & T ) -> K , K : Ord > ( v1 : T , v2 : T , mut f : F ) -> T {
1274
+ max_by ( v1, v2, |v1, v2| f ( v1) . cmp ( & f ( v2) ) )
1297
1275
}
1298
1276
1299
1277
// Implementation of PartialEq, Eq, PartialOrd and Ord for primitive types
0 commit comments