@@ -433,6 +433,89 @@ fn main_0() -> i32 {
433433 == ( m. as_pointer( ) as Ptr <Map <i16 , ( Value <i16 >, Value <u32 >) >>)
434434 . with( |__m: & Map <i16 , ( Value <i16 >, Value <u32 >) >| __m. end( ) )
435435 ) ;
436+ ( m. as_pointer ( ) as Ptr < Map < i16 , ( Value < i16 > , Value < u32 > ) > > )
437+ . with_mut ( |__m : & mut Map < i16 , ( Value < i16 > , Value < u32 > ) > | {
438+ __m. get_or_insert_with ( 7_i16 . clone ( ) , || {
439+ (
440+ Rc :: new ( RefCell :: new ( 7_i16 ) ) ,
441+ Rc :: new ( RefCell :: new ( <u32 >:: default ( ) ) ) ,
442+ )
443+ } )
444+ . borrow ( )
445+ . 1
446+ . as_pointer ( )
447+ } )
448+ . write ( 7_u32 ) ;
449+ ( m. as_pointer ( ) as Ptr < Map < i16 , ( Value < i16 > , Value < u32 > ) > > )
450+ . with_mut ( |__m : & mut Map < i16 , ( Value < i16 > , Value < u32 > ) > | {
451+ __m. get_or_insert_with ( 8_i16 . clone ( ) , || {
452+ (
453+ Rc :: new ( RefCell :: new ( 8_i16 ) ) ,
454+ Rc :: new ( RefCell :: new ( <u32 >:: default ( ) ) ) ,
455+ )
456+ } )
457+ . borrow ( )
458+ . 1
459+ . as_pointer ( )
460+ } )
461+ . write ( 8_u32 ) ;
462+ ( m. as_pointer ( ) as Ptr < Map < i16 , ( Value < i16 > , Value < u32 > ) > > )
463+ . with_mut ( |__m : & mut Map < i16 , ( Value < i16 > , Value < u32 > ) > | {
464+ __m. get_or_insert_with ( 9_i16 . clone ( ) , || {
465+ (
466+ Rc :: new ( RefCell :: new ( 9_i16 ) ) ,
467+ Rc :: new ( RefCell :: new ( <u32 >:: default ( ) ) ) ,
468+ )
469+ } )
470+ . borrow ( )
471+ . 1
472+ . as_pointer ( )
473+ } )
474+ . write ( 9_u32 ) ;
475+ assert ! ( ( ( * r. upgrade( ) . deref( ) ) . len( ) == 6_usize ) ) ;
476+ assert ! (
477+ ( ( m. as_pointer( ) as Ptr <Map <i16 , ( Value <i16 >, Value <u32 >) >>)
478+ . with_mut( |__m: & mut Map <i16 , ( Value <i16 >, Value <u32 >) >| __m. erase_key( & 10_i16 ) )
479+ == 0_usize )
480+ ) ;
481+ let mut key9: i32 = 9 ;
482+ assert ! (
483+ ( ( m. as_pointer( ) as Ptr <Map <i16 , ( Value <i16 >, Value <u32 >) >>)
484+ . with_mut( |__m: & mut Map <i16 , ( Value <i16 >, Value <u32 >) >| __m. erase_key( & ( key9 as i16 ) ) )
485+ == 1_usize )
486+ ) ;
487+ assert ! ( ( ( * r. upgrade( ) . deref( ) ) . len( ) == 5_usize ) ) ;
488+ let cit: Value < BidirectionalIterator < ( Value < i16 > , Value < u32 > ) > > = Rc :: new ( RefCell :: new (
489+ <BidirectionalIterator < ( Value < i16 > , Value < u32 > ) > >:: from (
490+ ( m. as_pointer ( ) as Ptr < Map < i16 , ( Value < i16 > , Value < u32 > ) > > )
491+ . with ( |__m : & Map < i16 , ( Value < i16 > , Value < u32 > ) > | __m. find ( & 7_i16 ) ) ,
492+ ) ,
493+ ) ) ;
494+ let next: Value < BidirectionalIterator < ( Value < i16 > , Value < u32 > ) > > = Rc :: new ( RefCell :: new (
495+ ( m. as_pointer ( ) as Ptr < Map < i16 , ( Value < i16 > , Value < u32 > ) > > ) . with_mut (
496+ |__m : & mut Map < i16 , ( Value < i16 > , Value < u32 > ) > | __m. erase ( & ( * cit. borrow ( ) ) . clone ( ) ) ,
497+ ) ,
498+ ) ) ;
499+ assert ! (
500+ ( * next. borrow( ) )
501+ == ( m. as_pointer( ) as Ptr <Map <i16 , ( Value <i16 >, Value <u32 >) >>)
502+ . with( |__m: & Map <i16 , ( Value <i16 >, Value <u32 >) >| __m. find( & 8_i16 ) )
503+ ) ;
504+ ( * next. borrow_mut ( ) ) = ( m. as_pointer ( ) as Ptr < Map < i16 , ( Value < i16 > , Value < u32 > ) > > ) . with_mut (
505+ |__m : & mut Map < i16 , ( Value < i16 > , Value < u32 > ) > | __m. erase ( & ( * next. borrow ( ) ) . clone ( ) ) ,
506+ ) ;
507+ assert ! (
508+ ( * next. borrow( ) )
509+ == ( m. as_pointer( ) as Ptr <Map <i16 , ( Value <i16 >, Value <u32 >) >>)
510+ . with( |__m: & Map <i16 , ( Value <i16 >, Value <u32 >) >| __m. end( ) )
511+ ) ;
512+ assert ! ( ( ( * r. upgrade( ) . deref( ) ) . len( ) == 3_usize ) ) ;
513+ assert ! (
514+ ( m. as_pointer( ) as Ptr <Map <i16 , ( Value <i16 >, Value <u32 >) >>)
515+ . with( |__m: & Map <i16 , ( Value <i16 >, Value <u32 >) >| __m. find( & 8_i16 ) )
516+ == ( m. as_pointer( ) as Ptr <Map <i16 , ( Value <i16 >, Value <u32 >) >>)
517+ . with( |__m: & Map <i16 , ( Value <i16 >, Value <u32 >) >| __m. end( ) )
518+ ) ;
436519 let other_map: Value <
437520 Map < ( Value < i32 > , Value < i64 > ) , ( Value < ( Value < i32 > , Value < i64 > ) > , Value < f64 > ) > ,
438521 > = Rc :: new ( RefCell :: new ( Map :: new ( ) ) ) ;
0 commit comments