File tree 2 files changed +17
-10
lines changed 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -1234,17 +1234,23 @@ where
1234
1234
F : ~const Destruct ,
1235
1235
K : ~const Destruct ,
1236
1236
{
1237
- const fn imp < T , F : ~const FnMut ( & T ) -> K , K : ~const Ord > (
1238
- f : & mut F ,
1239
- ( v1, v2) : ( & T , & T ) ,
1240
- ) -> Ordering
1241
- where
1242
- T : ~const Destruct ,
1243
- K : ~const Destruct ,
1244
- {
1245
- f ( v1) . cmp ( & f ( v2) )
1237
+ cfg_if ! {
1238
+ if #[ cfg( bootstrap) ] {
1239
+ const fn imp<T , F : ~const FnMut ( & T ) -> K , K : ~const Ord >(
1240
+ f: & mut F ,
1241
+ ( v1, v2) : ( & T , & T ) ,
1242
+ ) -> Ordering
1243
+ where
1244
+ T : ~const Destruct ,
1245
+ K : ~const Destruct ,
1246
+ {
1247
+ f( v1) . cmp( & f( v2) )
1248
+ }
1249
+ min_by( v1, v2, ConstFnMutClosure :: new( & mut f, imp) )
1250
+ } else {
1251
+ min_by( v1, v2, const |v1, v2| f( v1) . cmp( & f( v2) ) )
1252
+ }
1246
1253
}
1247
- min_by ( v1, v2, ConstFnMutClosure :: new ( & mut f, imp) )
1248
1254
}
1249
1255
1250
1256
/// Compares and returns the maximum of two values.
Original file line number Diff line number Diff line change 191
191
#![ feature( cfg_sanitize) ]
192
192
#![ feature( cfg_target_has_atomic) ]
193
193
#![ feature( cfg_target_has_atomic_equal_alignment) ]
194
+ #![ cfg_attr( not( bootstrap) , feature( const_closures) ) ]
194
195
#![ feature( const_fn_floating_point_arithmetic) ]
195
196
#![ feature( const_mut_refs) ]
196
197
#![ feature( const_precise_live_drops) ]
You can’t perform that action at this time.
0 commit comments