File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -1234,17 +1234,23 @@ where
12341234 F : ~const Destruct ,
12351235 K : ~const Destruct ,
12361236{
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+ }
12461253 }
1247- min_by ( v1, v2, ConstFnMutClosure :: new ( & mut f, imp) )
12481254}
12491255
12501256/// Compares and returns the maximum of two values.
Original file line number Diff line number Diff line change 191191#![ feature( cfg_sanitize) ]
192192#![ feature( cfg_target_has_atomic) ]
193193#![ feature( cfg_target_has_atomic_equal_alignment) ]
194+ #![ cfg_attr( not( bootstrap) , feature( const_closures) ) ]
194195#![ feature( const_fn_floating_point_arithmetic) ]
195196#![ feature( const_mut_refs) ]
196197#![ feature( const_precise_live_drops) ]
You can’t perform that action at this time.
0 commit comments