@@ -558,7 +558,7 @@ fn poll_with_local_instance<F: Future + Send + ?Sized>(
558558 let state = ResetInstanceThreadLocalState ( INSTANCE_STATE . with ( |v| {
559559 v. replace ( InstanceThreadLocalState :: PollingWith {
560560 instance,
561- store : VMStoreRawPtr ( store. into ( ) ) ,
561+ store : VMStoreRawPtr ( store. traitobj ( ) ) ,
562562 } )
563563 } ) ) ;
564564
@@ -614,11 +614,15 @@ fn poll_with_state<T: 'static, F: Future + Send + ?Sized>(
614614 mut future : Pin < & mut F > ,
615615) -> Poll < F :: Output > {
616616 with_local_instance ( |store, instance| {
617- let store_ptr = store as * mut dyn VMStore ;
617+ let store_ptr = store. traitobj ( ) ;
618618 let store_cx = token. as_context_mut ( store) ;
619619
620620 let result = {
621- let old_state = STATE . with ( |v| v. replace ( Some ( State { store : store_ptr } ) ) ) ;
621+ let old_state = STATE . with ( |v| {
622+ v. replace ( Some ( State {
623+ store : store_ptr. as_ptr ( ) ,
624+ } ) )
625+ } ) ;
622626 let _reset_state = ResetState ( old_state) ;
623627 poll_with_local_instance ( store_cx. 0 . traitobj_mut ( ) , instance, & mut future, cx)
624628 } ;
@@ -1958,7 +1962,7 @@ impl Instance {
19581962 // SAFETY: This is only ever called from a fiber that belongs to this
19591963 // store (and would in any case panic if called from outside any fiber).
19601964 unsafe {
1961- async_cx. suspend ( Some ( store) ) ?;
1965+ async_cx. suspend ( Some ( store. traitobj ( ) . as_ptr ( ) ) ) ?;
19621966 }
19631967
19641968 if let Some ( task) = task {
@@ -2904,7 +2908,7 @@ impl Instance {
29042908 // automatically from the event loop if it doesn't complete immediately
29052909 // here.
29062910 let poll = poll_with_local_instance (
2907- store. traitobj_mut ( ) ,
2911+ store,
29082912 self ,
29092913 & mut future. as_mut ( ) ,
29102914 & mut Context :: from_waker ( & dummy_waker ( ) ) ,
0 commit comments