File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -415,7 +415,10 @@ impl<T> Rc<T> {
415
415
/// [`upgrade`]: Weak::upgrade
416
416
#[ cfg( not( no_global_oom_handling) ) ]
417
417
#[ stable( feature = "arc_new_cyclic" , since = "1.59.0" ) ]
418
- pub fn new_cyclic ( data_fn : impl FnOnce ( & Weak < T > ) -> T ) -> Rc < T > {
418
+ pub fn new_cyclic < F > ( data_fn : F ) -> Rc < T >
419
+ where
420
+ F : FnOnce ( & Weak < T > ) -> T ,
421
+ {
419
422
// Construct the inner in the "uninitialized" state with a single
420
423
// weak reference.
421
424
let uninit_ptr: NonNull < _ > = Box :: leak ( box RcBox {
Original file line number Diff line number Diff line change @@ -392,7 +392,10 @@ impl<T> Arc<T> {
392
392
#[ cfg( not( no_global_oom_handling) ) ]
393
393
#[ inline]
394
394
#[ stable( feature = "arc_new_cyclic" , since = "1.59.0" ) ]
395
- pub fn new_cyclic ( data_fn : impl FnOnce ( & Weak < T > ) -> T ) -> Arc < T > {
395
+ pub fn new_cyclic < F > ( data_fn : F ) -> Arc < T >
396
+ where
397
+ F : FnOnce ( & Weak < T > ) -> T ,
398
+ {
396
399
// Construct the inner in the "uninitialized" state with a single
397
400
// weak reference.
398
401
let uninit_ptr: NonNull < _ > = Box :: leak ( box ArcInner {
You can’t perform that action at this time.
0 commit comments