File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 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> {
415415 /// [`upgrade`]: Weak::upgrade
416416 #[ cfg( not( no_global_oom_handling) ) ]
417417 #[ 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+ {
419422 // Construct the inner in the "uninitialized" state with a single
420423 // weak reference.
421424 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> {
392392 #[ cfg( not( no_global_oom_handling) ) ]
393393 #[ inline]
394394 #[ 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+ {
396399 // Construct the inner in the "uninitialized" state with a single
397400 // weak reference.
398401 let uninit_ptr: NonNull < _ > = Box :: leak ( box ArcInner {
You can’t perform that action at this time.
0 commit comments