File tree 2 files changed +46
-0
lines changed
2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -1436,6 +1436,29 @@ impl<T: ?Sized> fmt::Pointer for Rc<T> {
1436
1436
}
1437
1437
}
1438
1438
1439
+ #[ stable( feature = "rc_fn" , since = "1.45.0" ) ]
1440
+ impl < A , F : Fn < A > + ?Sized > FnOnce < A > for Rc < F > {
1441
+ type Output = <F as FnOnce < A > >:: Output ;
1442
+
1443
+ extern "rust-call" fn call_once ( self , args : A ) -> Self :: Output {
1444
+ <F as Fn < A > >:: call ( & * self , args)
1445
+ }
1446
+ }
1447
+
1448
+ #[ stable( feature = "rc_fn" , since = "1.45.0" ) ]
1449
+ impl < A , F : Fn < A > + ?Sized > FnMut < A > for Rc < F > {
1450
+ extern "rust-call" fn call_mut ( & mut self , args : A ) -> Self :: Output {
1451
+ <F as Fn < A > >:: call ( self , args)
1452
+ }
1453
+ }
1454
+
1455
+ #[ stable( feature = "rc_fn" , since = "1.45.0" ) ]
1456
+ impl < A , F : Fn < A > + ?Sized > Fn < A > for Rc < F > {
1457
+ extern "rust-call" fn call ( & self , args : A ) -> Self :: Output {
1458
+ <F as Fn < A > >:: call ( self , args)
1459
+ }
1460
+ }
1461
+
1439
1462
#[ stable( feature = "from_for_ptrs" , since = "1.6.0" ) ]
1440
1463
impl < T > From < T > for Rc < T > {
1441
1464
fn from ( t : T ) -> Self {
Original file line number Diff line number Diff line change @@ -2066,6 +2066,29 @@ impl<T: ?Sized + Hash> Hash for Arc<T> {
2066
2066
}
2067
2067
}
2068
2068
2069
+ #[ stable( feature = "rc_fn" , since = "1.45.0" ) ]
2070
+ impl < A , F : Fn < A > + ?Sized > FnOnce < A > for Arc < F > {
2071
+ type Output = <F as FnOnce < A > >:: Output ;
2072
+
2073
+ extern "rust-call" fn call_once ( self , args : A ) -> Self :: Output {
2074
+ <F as Fn < A > >:: call ( & * self , args)
2075
+ }
2076
+ }
2077
+
2078
+ #[ stable( feature = "rc_fn" , since = "1.45.0" ) ]
2079
+ impl < A , F : Fn < A > + ?Sized > FnMut < A > for Arc < F > {
2080
+ extern "rust-call" fn call_mut ( & mut self , args : A ) -> Self :: Output {
2081
+ <F as Fn < A > >:: call ( self , args)
2082
+ }
2083
+ }
2084
+
2085
+ #[ stable( feature = "rc_fn" , since = "1.45.0" ) ]
2086
+ impl < A , F : Fn < A > + ?Sized > Fn < A > for Arc < F > {
2087
+ extern "rust-call" fn call ( & self , args : A ) -> Self :: Output {
2088
+ <F as Fn < A > >:: call ( self , args)
2089
+ }
2090
+ }
2091
+
2069
2092
#[ stable( feature = "from_for_ptrs" , since = "1.6.0" ) ]
2070
2093
impl < T > From < T > for Arc < T > {
2071
2094
fn from ( t : T ) -> Self {
You can’t perform that action at this time.
0 commit comments