Skip to content

Commit cc11e0b

Browse files
committed
---
yaml --- r: 196266 b: refs/heads/tmp c: 27b7841 h: refs/heads/master v: v3
1 parent d68fc93 commit cc11e0b

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: 9854143cba679834bc4ef932858cd5303f015a0e
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: cdb10b884b3975dd897096e052f386f55cf0f4c9
35+
refs/heads/tmp: 27b7841bb1261fb2d94a0ed6f2ec0a146a44783d
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: 53a183f0274316596bf9405944d4f0468d8c93e4
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/src/libcore/ops.rs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,3 +1142,52 @@ pub trait FnOnce<Args> {
11421142
/// This is called when the call operator is used.
11431143
extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
11441144
}
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+
}

0 commit comments

Comments
 (0)