Skip to content

Commit d7c7776

Browse files
committed
---
yaml --- r: 195563 b: refs/heads/master c: 27b7841 h: refs/heads/master i: 195561: ad4ab49 195559: 4539a45 v: v3
1 parent 71b2dd8 commit d7c7776

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: cdb10b884b3975dd897096e052f386f55cf0f4c9
2+
refs/heads/master: 27b7841bb1261fb2d94a0ed6f2ec0a146a44783d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b3317d68910900f135f9f38e43a7a699bc736b4a
55
refs/heads/try: 961e0358e1a5c0faaef606e31e9965742c1643bf

trunk/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)