@@ -9,41 +9,48 @@ struct Foo;
99impl Fn < ( isize , isize ) > for Foo {
1010 extern "rust-call" fn call ( & self , args : ( isize , isize ) ) -> Self :: Output {
1111 println ! ( "{:?}" , args) ;
12+ ( args. 0 + 1 , args. 1 + 1 )
1213 }
1314}
1415
1516impl FnMut < ( isize , isize ) > for Foo {
1617 extern "rust-call" fn call_mut ( & mut self , args : ( isize , isize ) ) -> Self :: Output {
1718 println ! ( "{:?}" , args) ;
19+ ( args. 0 + 1 , args. 1 + 1 )
1820 }
1921}
2022
2123impl FnOnce < ( isize , isize ) > for Foo {
22- type Output = ( ) ;
24+ type Output = ( isize , isize ) ;
2325 extern "rust-call" fn call_once ( self , args : ( isize , isize ) ) -> Self :: Output {
2426 println ! ( "{:?}" , args) ;
27+ ( args. 0 + 1 , args. 1 + 1 )
2528 }
2629}
2730
2831impl Fn < ( isize , isize , isize ) > for Foo {
2932 extern "rust-call" fn call ( & self , args : ( isize , isize , isize ) ) -> Self :: Output {
3033 println ! ( "{:?}" , args) ;
34+ ( args. 0 + 3 , args. 1 + 3 , args. 2 + 3 )
3135 }
3236}
3337
3438impl FnMut < ( isize , isize , isize ) > for Foo {
3539 extern "rust-call" fn call_mut ( & mut self , args : ( isize , isize , isize ) ) -> Self :: Output {
3640 println ! ( "{:?}" , args) ;
41+ ( args. 0 + 3 , args. 1 + 3 , args. 2 + 3 )
3742 }
3843}
3944impl FnOnce < ( isize , isize , isize ) > for Foo {
40- type Output = ( ) ;
45+ type Output = ( isize , isize , isize ) ;
4146 extern "rust-call" fn call_once ( self , args : ( isize , isize , isize ) ) -> Self :: Output {
4247 println ! ( "{:?}" , args) ;
48+ ( args. 0 + 3 , args. 1 + 3 , args. 2 + 3 )
4349 }
4450}
4551
4652fn main ( ) {
4753 let foo = Foo ;
48- foo ( 1 , 1 ) ;
54+ assert_eq ! ( foo( 1 , 1 ) , ( 2 , 2 ) ) ;
55+ assert_eq ! ( foo( 1 , 1 , 1 ) , ( 4 , 4 , 4 ) ) ;
4956}
0 commit comments