@@ -13,11 +13,12 @@ pub struct Inner {
1313}
1414impl Clone for Inner {
1515 fn clone ( & self ) -> Self {
16- let mut this = Self {
16+ let __this : Value < Inner > = Rc :: new ( RefCell :: new ( Self {
1717 x : Rc :: new ( RefCell :: new ( ( * self . x . borrow ( ) ) ) ) ,
1818 y : Rc :: new ( RefCell :: new ( ( * self . y . borrow ( ) ) ) ) ,
19- } ;
20- this
19+ } ) ) ;
20+ let this: Ptr < Inner > = __this. as_pointer ( ) ;
21+ Rc :: try_unwrap ( __this) . ok ( ) . unwrap ( ) . into_inner ( )
2122 }
2223}
2324impl Default for Inner {
@@ -52,13 +53,14 @@ pub struct S {
5253}
5354impl Clone for S {
5455 fn clone ( & self ) -> Self {
55- let mut this = Self {
56+ let __this : Value < S > = Rc :: new ( RefCell :: new ( Self {
5657 a : Rc :: new ( RefCell :: new ( ( * self . a . borrow ( ) ) ) ) ,
5758 b : Rc :: new ( RefCell :: new ( ( * self . b . borrow ( ) ) ) ) ,
5859 c : Rc :: new ( RefCell :: new ( ( * self . c . borrow ( ) ) . clone ( ) ) ) ,
5960 d : Rc :: new ( RefCell :: new ( ( * self . d . borrow ( ) ) . clone ( ) ) ) ,
60- } ;
61- this
61+ } ) ) ;
62+ let this: Ptr < S > = __this. as_pointer ( ) ;
63+ Rc :: try_unwrap ( __this) . ok ( ) . unwrap ( ) . into_inner ( )
6264 }
6365}
6466impl Default for S {
@@ -102,20 +104,22 @@ impl Boxed_int_ {
102104 pub fn Boxed_int_ ( x : i32 , t : i32 ) -> Self {
103105 let x: Value < i32 > = Rc :: new ( RefCell :: new ( x) ) ;
104106 let t: Value < i32 > = Rc :: new ( RefCell :: new ( t) ) ;
105- let mut this = Self {
107+ let __this : Value < Boxed_int_ > = Rc :: new ( RefCell :: new ( Self {
106108 v : Rc :: new ( RefCell :: new ( ( * x. borrow ( ) ) ) ) ,
107109 tag : Rc :: new ( RefCell :: new ( ( * t. borrow ( ) ) ) ) ,
108- } ;
109- this
110+ } ) ) ;
111+ let this: Ptr < Boxed_int_ > = __this. as_pointer ( ) ;
112+ Rc :: try_unwrap ( __this) . ok ( ) . unwrap ( ) . into_inner ( )
110113 }
111114}
112115impl Clone for Boxed_int_ {
113116 fn clone ( & self ) -> Self {
114- let mut this = Self {
117+ let __this : Value < Boxed_int_ > = Rc :: new ( RefCell :: new ( Self {
115118 v : Rc :: new ( RefCell :: new ( ( * self . v . borrow ( ) ) ) ) ,
116119 tag : Rc :: new ( RefCell :: new ( ( * self . tag . borrow ( ) ) ) ) ,
117- } ;
118- this
120+ } ) ) ;
121+ let this: Ptr < Boxed_int_ > = __this. as_pointer ( ) ;
122+ Rc :: try_unwrap ( __this) . ok ( ) . unwrap ( ) . into_inner ( )
119123 }
120124}
121125impl Default for Boxed_int_ {
@@ -142,6 +146,7 @@ impl ByteRepr for Boxed_int_ {
142146 }
143147}
144148pub fn main ( ) {
149+ __cpp2rust_init_globals ( ) ;
145150 std:: process:: exit ( main_0 ( ) ) ;
146151}
147152fn main_0 ( ) -> i32 {
@@ -157,3 +162,4 @@ fn main_0() -> i32 {
157162 assert ! ( ( ( * ( * boxed. borrow( ) ) . tag. borrow( ) ) == 9 ) ) ;
158163 return 0 ;
159164}
165+ pub fn __cpp2rust_init_globals ( ) { }
0 commit comments