@@ -12,7 +12,7 @@ pub struct S {
1212 pub n : Value < Box < [ i32 ] > > ,
1313}
1414impl S {
15- pub fn S ( x : i32 ) -> Self {
15+ pub fn new ( x : i32 ) -> Self {
1616 let x: Value < i32 > = Rc :: new ( RefCell :: new ( x) ) ;
1717 let __this: Value < S > = Rc :: new ( RefCell :: new ( Self {
1818 v : Rc :: new ( RefCell :: new ( vec ! [
@@ -24,7 +24,7 @@ impl S {
2424 let this: Ptr < S > = __this. as_pointer ( ) ;
2525 Rc :: try_unwrap ( __this) . ok ( ) . unwrap ( ) . into_inner ( )
2626 }
27- pub fn move_from ( _a0 : Ptr < S > ) -> Self {
27+ pub fn S_pmutS_rv ( _a0 : Ptr < S > ) -> Self {
2828 let __this: Value < S > = Rc :: new ( RefCell :: new ( Self {
2929 v : Rc :: new ( RefCell :: new ( std:: mem:: take (
3030 & mut ( * ( * _a0. upgrade ( ) . deref ( ) ) . v . borrow_mut ( ) ) ,
@@ -76,26 +76,26 @@ pub fn main() {
7676 std:: process:: exit ( main_0 ( ) ) ;
7777}
7878fn main_0 ( ) -> i32 {
79- let s: Value < S > = Rc :: new ( RefCell :: new ( S :: S ( { 2 } ) ) ) ;
79+ let s: Value < S > = Rc :: new ( RefCell :: new ( S :: new ( { 2 } ) ) ) ;
8080 assert ! ( ( ( { sum_0( s. as_pointer( ) , ) } ) == 7 ) ) ;
8181 assert ! ( ( ( { shuffle_1( 3 , ) } ) == 10 ) ) ;
8282 return 0 ;
8383}
8484pub fn shuffle_1 ( x : i32 ) -> i32 {
8585 let x: Value < i32 > = Rc :: new ( RefCell :: new ( x) ) ;
86- let a: Value < S > = Rc :: new ( RefCell :: new ( S :: S ( { ( * x. borrow ( ) ) } ) ) ) ;
87- let b: Value < S > = Rc :: new ( RefCell :: new ( S :: move_from ( { a. as_pointer ( ) } ) ) ) ;
86+ let a: Value < S > = Rc :: new ( RefCell :: new ( S :: new ( { ( * x. borrow ( ) ) } ) ) ) ;
87+ let b: Value < S > = Rc :: new ( RefCell :: new ( S :: S_pmutS_rv ( { a. as_pointer ( ) } ) ) ) ;
8888 assert ! ( ( * ( * a. borrow( ) ) . v. borrow( ) ) . is_empty( ) ) ;
89- let c: Value < S > = Rc :: new ( RefCell :: new ( S :: S ( { 1 } ) ) ) ;
90- ( { SImpl :: move_assign ( & c. as_pointer ( ) , b. as_pointer ( ) ) } ) ;
89+ let c: Value < S > = Rc :: new ( RefCell :: new ( S :: new ( { 1 } ) ) ) ;
90+ ( { SImpl :: operator_assign_pmutS_rv ( & c. as_pointer ( ) , b. as_pointer ( ) ) } ) ;
9191 assert ! ( ( * ( * b. borrow( ) ) . v. borrow( ) ) . is_empty( ) ) ;
9292 return ( { sum_0 ( c. as_pointer ( ) ) } ) ;
9393}
9494pub trait SImpl {
95- fn move_assign ( & self , _a0 : Ptr < S > ) -> Ptr < S > ;
95+ fn operator_assign_pmutS_rv ( & self , _a0 : Ptr < S > ) -> Ptr < S > ;
9696}
9797impl SImpl for Ptr < S > {
98- fn move_assign ( & self , _a0 : Ptr < S > ) -> Ptr < S > {
98+ fn operator_assign_pmutS_rv ( & self , _a0 : Ptr < S > ) -> Ptr < S > {
9999 ( ( * ( * self ) . upgrade ( ) . deref ( ) ) . v . as_pointer ( ) as Ptr < Vec < i32 > > ) . write ( std:: mem:: take (
100100 & mut ( * ( * _a0. upgrade ( ) . deref ( ) ) . v . borrow_mut ( ) ) ,
101101 ) ) ;
0 commit comments