File tree Expand file tree Collapse file tree 2 files changed +50
-1
lines changed Expand file tree Collapse file tree 2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: cdb10b884b3975dd897096e052f386f55cf0f4c9
2
+ refs/heads/master: 27b7841bb1261fb2d94a0ed6f2ec0a146a44783d
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: b3317d68910900f135f9f38e43a7a699bc736b4a
5
5
refs/heads/try: 961e0358e1a5c0faaef606e31e9965742c1643bf
Original file line number Diff line number Diff line change @@ -1142,3 +1142,52 @@ pub trait FnOnce<Args> {
1142
1142
/// This is called when the call operator is used.
1143
1143
extern "rust-call" fn call_once ( self , args : Args ) -> Self :: Output ;
1144
1144
}
1145
+
1146
+ #[ cfg( not( stage0) ) ]
1147
+ mod impls {
1148
+ use marker:: Sized ;
1149
+ use super :: { Fn , FnMut , FnOnce } ;
1150
+
1151
+ impl < ' a , A , F : ?Sized > Fn < A > for & ' a F
1152
+ where F : Fn < A >
1153
+ {
1154
+ extern "rust-call" fn call ( & self , args : A ) -> F :: Output {
1155
+ ( * * self ) . call ( args)
1156
+ }
1157
+ }
1158
+
1159
+ impl < ' a , A , F : ?Sized > FnMut < A > for & ' a F
1160
+ where F : Fn < A >
1161
+ {
1162
+ extern "rust-call" fn call_mut ( & mut self , args : A ) -> F :: Output {
1163
+ ( * * self ) . call ( args)
1164
+ }
1165
+ }
1166
+
1167
+ impl < ' a , A , F : ?Sized > FnOnce < A > for & ' a F
1168
+ where F : Fn < A >
1169
+ {
1170
+ type Output = F :: Output ;
1171
+
1172
+ extern "rust-call" fn call_once ( self , args : A ) -> F :: Output {
1173
+ ( * self ) . call ( args)
1174
+ }
1175
+ }
1176
+
1177
+ impl < ' a , A , F : ?Sized > FnMut < A > for & ' a mut F
1178
+ where F : FnMut < A >
1179
+ {
1180
+ extern "rust-call" fn call_mut ( & mut self , args : A ) -> F :: Output {
1181
+ ( * self ) . call_mut ( args)
1182
+ }
1183
+ }
1184
+
1185
+ impl < ' a , A , F : ?Sized > FnOnce < A > for & ' a mut F
1186
+ where F : FnMut < A >
1187
+ {
1188
+ type Output = F :: Output ;
1189
+ extern "rust-call" fn call_once ( mut self , args : A ) -> F :: Output {
1190
+ ( * self ) . call_mut ( args)
1191
+ }
1192
+ }
1193
+ }
You can’t perform that action at this time.
0 commit comments