@@ -103,6 +103,47 @@ impl ByteRepr for NonConst {
103103 }
104104 }
105105}
106+ #[ derive( Default ) ]
107+ pub struct Ignored {
108+ pub v : Value < i32 > ,
109+ }
110+ impl Ignored {
111+ pub fn Ignored ( v : i32 ) -> Self {
112+ let v: Value < i32 > = Rc :: new ( RefCell :: new ( v) ) ;
113+ let __this: Value < Ignored > = Rc :: new ( RefCell :: new ( Self {
114+ v : Rc :: new ( RefCell :: new ( ( * v. borrow ( ) ) ) ) ,
115+ } ) ) ;
116+ let this: Ptr < Ignored > = __this. as_pointer ( ) ;
117+ Rc :: try_unwrap ( __this) . ok ( ) . unwrap ( ) . into_inner ( )
118+ }
119+ pub fn Ignored_pconstIgnored ( _a0 : Ptr < Ignored > ) -> Self {
120+ let __this: Value < Ignored > = Rc :: new ( RefCell :: new ( Self {
121+ v : Rc :: new ( RefCell :: new ( -1_i32 ) ) ,
122+ } ) ) ;
123+ let this: Ptr < Ignored > = __this. as_pointer ( ) ;
124+ ( * copies_0. with ( Value :: clone) . borrow_mut ( ) ) . prefix_inc ( ) ;
125+ Rc :: try_unwrap ( __this) . ok ( ) . unwrap ( ) . into_inner ( )
126+ }
127+ }
128+ impl Clone for Ignored {
129+ fn clone ( & self ) -> Self {
130+ let __src: Value < Ignored > = Rc :: new ( RefCell :: new ( Ignored { v : self . v . clone ( ) } ) ) ;
131+ Ignored :: Ignored_pconstIgnored ( __src. as_pointer ( ) )
132+ }
133+ }
134+ impl ByteRepr for Ignored {
135+ fn byte_size ( ) -> usize {
136+ 4
137+ }
138+ fn to_bytes ( & self , buf : & mut [ u8 ] ) {
139+ ( * self . v . borrow ( ) ) . to_bytes ( & mut buf[ 0 ..4 ] ) ;
140+ }
141+ fn from_bytes ( buf : & [ u8 ] ) -> Self {
142+ Self {
143+ v : Rc :: new ( RefCell :: new ( <i32 >:: from_bytes ( & buf[ 0 ..4 ] ) ) ) ,
144+ }
145+ }
146+ }
106147#[ derive( ) ]
107148pub struct Holder {
108149 pub c : Value < Counted > ,
@@ -225,6 +266,12 @@ fn main_0() -> i32 {
225266 == 1 )
226267 ) ;
227268 assert ! ( ( copies_0. with( |rc| * rc. borrow( ) ) == 10 ) ) ;
269+ let i1: Value < Ignored > = Rc :: new ( RefCell :: new ( Ignored :: Ignored ( { 1 } ) ) ) ;
270+ let i2: Value < Ignored > = Rc :: new ( RefCell :: new ( Ignored :: Ignored_pconstIgnored ( {
271+ i1. as_pointer ( )
272+ } ) ) ) ;
273+ assert ! ( ( ( * ( * i1. borrow( ) ) . v. borrow( ) ) == 1 ) && ( ( * ( * i2. borrow( ) ) . v. borrow( ) ) == -1_i32 ) ) ;
274+ assert ! ( ( copies_0. with( |rc| * rc. borrow( ) ) == 11 ) ) ;
228275 let n: Value < NonConst > = Rc :: new ( RefCell :: new ( NonConst :: NonConst ( ) ) ) ;
229276 let n1: Value < NonConst > = Rc :: new ( RefCell :: new ( NonConst :: NonConst_pmutNonConst ( {
230277 n. as_pointer ( )
0 commit comments