@@ -387,8 +387,6 @@ struct ResetInstance(Option<SendSyncPtr<ComponentInstance>>);
387387
388388impl Drop for ResetInstance {
389389 fn drop ( & mut self ) {
390- eprintln ! ( "reset to: {:?}" , self . 0 ) ;
391-
392390 INSTANCE . with ( |v| v. set ( self . 0 . map ( |v| v. as_ptr ( ) ) . unwrap_or_else ( ptr:: null_mut) ) )
393391 }
394392}
@@ -425,7 +423,6 @@ fn poll_with_state<T, F: Future + ?Sized>(
425423 } ) )
426424 } ) ;
427425 let _reset_state = ResetState ( old_state) ;
428- eprintln ! ( "set to: {:?}" , instance. as_ptr( ) ) ;
429426 let old_instance = INSTANCE . with ( |v| v. replace ( instance. as_ptr ( ) ) ) ;
430427 let _reset_instance = ResetInstance ( NonNull :: new ( old_instance) . map ( SendSyncPtr :: new) ) ;
431428 ( future. poll ( cx) , STATE . with ( |v| v. take ( ) ) . unwrap ( ) . spawned )
@@ -899,12 +896,8 @@ impl ComponentInstance {
899896 self . maybe_resume_next_task ( runtime_instance)
900897 }
901898
902- fn poll_for_result ( & mut self ) -> Result < ( ) > {
903- let task = * self . guest_task ( ) ;
904- self . poll_loop ( move |instance| {
905- task. map ( |task| Ok :: < _ , anyhow:: Error > ( instance. get ( task) ?. result . is_none ( ) ) )
906- . unwrap_or ( Ok ( true ) )
907- } )
899+ fn poll_for_result ( & mut self , task : TableId < GuestTask > ) -> Result < ( ) > {
900+ self . poll_loop ( move |instance| Ok :: < _ , anyhow:: Error > ( instance. get ( task) ?. result . is_none ( ) ) )
908901 }
909902
910903 fn handle_ready ( & mut self , ready : Vec < HostTaskOutput > ) -> Result < ( ) > {
@@ -1626,7 +1619,7 @@ impl ComponentInstance {
16261619 self . get_mut ( set) ?. waiting . insert ( caller) ;
16271620 Waitable :: Guest ( guest_task) . join ( self , Some ( set) ) ?;
16281621
1629- self . poll_for_result ( ) ?;
1622+ self . poll_for_result ( guest_task ) ?;
16301623 status = Status :: Returned ;
16311624 0
16321625 }
@@ -1880,7 +1873,6 @@ impl ComponentInstance {
18801873 store : StoreContextMut < ' _ , T > ,
18811874 future : Pin < Box < dyn Future < Output = R > + Send + ' _ > > ,
18821875 ) -> Result < R > {
1883- eprintln ! ( "set to: {:?}" , self as * mut _) ;
18841876 let old = INSTANCE . with ( |v| v. replace ( self ) ) ;
18851877 let _reset_instance = ResetInstance ( NonNull :: new ( old) . map ( SendSyncPtr :: new) ) ;
18861878 unsafe {
@@ -3639,7 +3631,6 @@ fn checked<F: Future + Send + 'static>(
36393631
36403632fn check_recursive_run ( ) {
36413633 INSTANCE . with ( |v| {
3642- eprintln ! ( "v.get(): {:?}" , v. get( ) ) ;
36433634 if !v. get ( ) . is_null ( ) {
36443635 panic ! ( "Recursive `Instance::run{{_with}}` calls not supported" )
36453636 }
0 commit comments