@@ -15,7 +15,7 @@ pub fn negate_1(mut x: i32) -> i32 {
1515pub fn add_2 ( mut a : i32 , mut b : i32 ) -> i32 {
1616 return ( a + b) ;
1717}
18- pub fn apply_unary_3 ( x : i32 , __args : & [ VaArg ] ) -> i32 {
18+ pub fn apply_unary_3 ( x : i32 , __args : Box < [ VaArg ] > ) -> i32 {
1919 let __args: Value < Box < [ VaArg ] > > = Rc :: new ( RefCell :: new ( __args. into ( ) ) ) ;
2020 let x: Value < i32 > = Rc :: new ( RefCell :: new ( x) ) ;
2121 let ap: Value < Ptr < VaArg > > = Rc :: new ( RefCell :: new ( Ptr :: < VaArg > :: default ( ) ) ) ;
@@ -24,7 +24,7 @@ pub fn apply_unary_3(x: i32, __args: &[VaArg]) -> i32 {
2424 let mut result: i32 = ( { fn_. call ( ( * x. borrow ( ) ) ) } ) ;
2525 return result;
2626}
27- pub fn apply_binary_4 ( mut a : i32 , b : i32 , __args : & [ VaArg ] ) -> i32 {
27+ pub fn apply_binary_4 ( mut a : i32 , b : i32 , __args : Box < [ VaArg ] > ) -> i32 {
2828 let __args: Value < Box < [ VaArg ] > > = Rc :: new ( RefCell :: new ( __args. into ( ) ) ) ;
2929 let b: Value < i32 > = Rc :: new ( RefCell :: new ( b) ) ;
3030 let ap: Value < Ptr < VaArg > > = Rc :: new ( RefCell :: new ( Ptr :: < VaArg > :: default ( ) ) ) ;
@@ -46,18 +46,31 @@ pub fn main() {
4646}
4747fn main_0 ( ) -> i32 {
4848 assert ! (
49- ( ( ( ( { apply_unary_3( 5 , & [ ( FnPtr :: <fn ( i32 ) -> i32 >:: new( square_0) ) . into( ) , ] ) } ) == 25 )
50- as i32 )
49+ ( ( ( ( {
50+ apply_unary_3(
51+ 5 ,
52+ Box :: new( [ ( FnPtr :: <fn ( i32 ) -> i32 >:: new( square_0) ) . into( ) ] ) ,
53+ )
54+ } ) == 25 ) as i32 )
5155 != 0 )
5256 ) ;
5357 assert ! (
54- ( ( ( ( { apply_unary_3( 7 , & [ ( FnPtr :: <fn ( i32 ) -> i32 >:: new( negate_1) ) . into( ) , ] ) } ) == -7_i32 )
55- as i32 )
58+ ( ( ( ( {
59+ apply_unary_3(
60+ 7 ,
61+ Box :: new( [ ( FnPtr :: <fn ( i32 ) -> i32 >:: new( negate_1) ) . into( ) ] ) ,
62+ )
63+ } ) == -7_i32 ) as i32 )
5664 != 0 )
5765 ) ;
5866 assert ! (
59- ( ( ( ( { apply_binary_4( 3 , 4 , & [ ( FnPtr :: <fn ( i32 , i32 ) -> i32 >:: new( add_2) ) . into( ) , ] ) } ) == 7 )
60- as i32 )
67+ ( ( ( ( {
68+ apply_binary_4(
69+ 3 ,
70+ 4 ,
71+ Box :: new( [ ( FnPtr :: <fn ( i32 , i32 ) -> i32 >:: new( add_2) ) . into( ) ] ) ,
72+ )
73+ } ) == 7 ) as i32 )
6174 != 0 )
6275 ) ;
6376 let dummy: Value < i32 > = Rc :: new ( RefCell :: new ( 0 ) ) ;
@@ -69,17 +82,28 @@ fn main_0() -> i32 {
6982 } ) == -3_i32 ) as i32 )
7083 != 0 )
7184 ) ;
72- let mut vu: FnPtr < fn ( i32 ) -> i32 > = FnPtr :: < fn ( i32 ) -> i32 > :: new ( apply_unary_3) ;
85+ let mut vu: FnPtr < fn ( i32 , Box < [ VaArg ] > ) -> i32 > =
86+ FnPtr :: < fn ( i32 , Box < [ VaArg ] > ) -> i32 > :: new ( apply_unary_3) ;
7387 assert ! (
74- ( ( ( ( { vu. call( 6 , & [ ( FnPtr :: <fn ( i32 ) -> i32 >:: new( square_0) ) . into( ) , ] ) } ) == 36 ) as i32 )
88+ ( ( ( ( {
89+ vu. call(
90+ 6 ,
91+ Box :: new( [ ( FnPtr :: <fn ( i32 ) -> i32 >:: new( square_0) ) . into( ) ] ) ,
92+ )
93+ } ) == 36 ) as i32 )
7594 != 0 )
7695 ) ;
77- let mut vb: FnPtr < fn ( i32 , i32 ) -> i32 > =
78- FnPtr :: < fn ( i32 ) -> i32 > :: new ( apply_unary_3) . cast :: < fn ( i32 , i32 ) -> i32 > ( ) ;
79- vu = vb. cast :: < fn ( i32 ) -> i32 > ( ) ;
96+ let mut vb: FnPtr < fn ( i32 , i32 , Box < [ VaArg ] > ) -> i32 > =
97+ FnPtr :: < fn ( i32 , Box < [ VaArg ] > ) -> i32 > :: new ( apply_unary_3)
98+ . cast :: < fn ( i32 , i32 , Box < [ VaArg ] > ) -> i32 > ( ) ;
99+ vu = vb. cast :: < fn ( i32 , Box < [ VaArg ] > ) -> i32 > ( ) ;
80100 assert ! (
81- ( ( ( ( { vu. call( 2 , & [ ( FnPtr :: <fn ( i32 ) -> i32 >:: new( negate_1) ) . into( ) , ] ) } ) == -2_i32 )
82- as i32 )
101+ ( ( ( ( {
102+ vu. call(
103+ 2 ,
104+ Box :: new( [ ( FnPtr :: <fn ( i32 ) -> i32 >:: new( negate_1) ) . into( ) ] ) ,
105+ )
106+ } ) == -2_i32 ) as i32 )
83107 != 0 )
84108 ) ;
85109 return 0 ;
0 commit comments