@@ -1117,29 +1117,33 @@ impl<'a, T: ?Sized> DerefMut for &'a mut T {
1117
1117
#[ lang="fn" ]
1118
1118
#[ unstable( feature = "core" ,
1119
1119
reason = "uncertain about variadic generics, input versus associated types" ) ]
1120
- pub trait Fn < Args , Result > {
1120
+ #[ cfg( stage0) ]
1121
+ pub trait Fn < Args , Output > {
1121
1122
/// This is called when the call operator is used.
1122
- extern "rust-call" fn call ( & self , args : Args ) -> Result ;
1123
+ extern "rust-call" fn call ( & self , args : Args ) -> Output ;
1123
1124
}
1124
1125
1125
1126
/// A version of the call operator that takes a mutable receiver.
1126
1127
#[ lang="fn_mut" ]
1127
1128
#[ unstable( feature = "core" ,
1128
1129
reason = "uncertain about variadic generics, input versus associated types" ) ]
1129
- pub trait FnMut < Args , Result > {
1130
+ #[ cfg( stage0) ]
1131
+ pub trait FnMut < Args , Output > {
1130
1132
/// This is called when the call operator is used.
1131
- extern "rust-call" fn call_mut ( & mut self , args : Args ) -> Result ;
1133
+ extern "rust-call" fn call_mut ( & mut self , args : Args ) -> Output ;
1132
1134
}
1133
1135
1134
1136
/// A version of the call operator that takes a by-value receiver.
1135
1137
#[ lang="fn_once" ]
1136
1138
#[ unstable( feature = "core" ,
1137
1139
reason = "uncertain about variadic generics, input versus associated types" ) ]
1138
- pub trait FnOnce < Args , Result > {
1140
+ #[ cfg( stage0) ]
1141
+ pub trait FnOnce < Args , Output > {
1139
1142
/// This is called when the call operator is used.
1140
- extern "rust-call" fn call_once ( self , args : Args ) -> Result ;
1143
+ extern "rust-call" fn call_once ( self , args : Args ) -> Output ;
1141
1144
}
1142
1145
1146
+ #[ cfg( stage0) ]
1143
1147
impl < F : ?Sized , A , R > FnMut < A , R > for F
1144
1148
where F : Fn < A , R >
1145
1149
{
@@ -1148,10 +1152,69 @@ impl<F: ?Sized, A, R> FnMut<A, R> for F
1148
1152
}
1149
1153
}
1150
1154
1155
+ #[ cfg( stage0) ]
1151
1156
impl < F , A , R > FnOnce < A , R > for F
1152
1157
where F : FnMut < A , R >
1153
1158
{
1154
1159
extern "rust-call" fn call_once ( mut self , args : A ) -> R {
1155
1160
self . call_mut ( args)
1156
1161
}
1157
1162
}
1163
+
1164
+ /// A version of the call operator that takes an immutable receiver.
1165
+ #[ lang="fn" ]
1166
+ #[ unstable( feature = "core" ,
1167
+ reason = "uncertain about variadic generics, input versus associated types" ) ]
1168
+ #[ cfg( not( stage0) ) ]
1169
+ pub trait Fn < Args > {
1170
+ type Output ;
1171
+
1172
+ /// This is called when the call operator is used.
1173
+ extern "rust-call" fn call ( & self , args : Args ) -> Self :: Output ;
1174
+ }
1175
+
1176
+ /// A version of the call operator that takes a mutable receiver.
1177
+ #[ lang="fn_mut" ]
1178
+ #[ unstable( feature = "core" ,
1179
+ reason = "uncertain about variadic generics, input versus associated types" ) ]
1180
+ #[ cfg( not( stage0) ) ]
1181
+ pub trait FnMut < Args > {
1182
+ type Output ;
1183
+
1184
+ /// This is called when the call operator is used.
1185
+ extern "rust-call" fn call_mut ( & mut self , args : Args ) -> Self :: Output ;
1186
+ }
1187
+
1188
+ /// A version of the call operator that takes a by-value receiver.
1189
+ #[ lang="fn_once" ]
1190
+ #[ unstable( feature = "core" ,
1191
+ reason = "uncertain about variadic generics, input versus associated types" ) ]
1192
+ #[ cfg( not( stage0) ) ]
1193
+ pub trait FnOnce < Args > {
1194
+ type Output ;
1195
+
1196
+ /// This is called when the call operator is used.
1197
+ extern "rust-call" fn call_once ( self , args : Args ) -> Self :: Output ;
1198
+ }
1199
+
1200
+ #[ cfg( not( stage0) ) ]
1201
+ impl < F : ?Sized , A > FnMut < A > for F
1202
+ where F : Fn < A >
1203
+ {
1204
+ type Output = <F as Fn < A > >:: Output ;
1205
+
1206
+ extern "rust-call" fn call_mut ( & mut self , args : A ) -> <F as Fn < A > >:: Output {
1207
+ self . call ( args)
1208
+ }
1209
+ }
1210
+
1211
+ #[ cfg( not( stage0) ) ]
1212
+ impl < F , A > FnOnce < A > for F
1213
+ where F : FnMut < A >
1214
+ {
1215
+ type Output = <F as FnMut < A > >:: Output ;
1216
+
1217
+ extern "rust-call" fn call_once ( mut self , args : A ) -> <F as FnMut < A > >:: Output {
1218
+ self . call_mut ( args)
1219
+ }
1220
+ }
0 commit comments