@@ -82,7 +82,6 @@ fn provenance_test_config() -> Config {
8282 config. memory_reservation ( 1 << 20 ) ;
8383 config. memory_guard_size ( 0 ) ;
8484 config. signals_based_traps ( false ) ;
85- config. async_support ( true ) ;
8685 config. wasm_component_model_async ( true ) ;
8786 config. wasm_component_model_async_stackful ( true ) ;
8887 config. wasm_component_model_async_builtins ( true ) ;
@@ -114,9 +113,9 @@ fn provenance_test_config() -> Config {
114113/// and instructions. The goal is to kind of do a dry run of interesting
115114/// shapes/sizes of what you can do with core wasm and ensure MIRI gives us a
116115/// clean bill of health.
117- #[ tokio :: test]
116+ #[ test]
118117#[ cfg_attr( miri, ignore) ]
119- async fn pulley_provenance_test ( ) -> Result < ( ) > {
118+ fn pulley_provenance_test ( ) -> Result < ( ) > {
120119 let config = provenance_test_config ( ) ;
121120 let engine = Engine :: new ( & config) ?;
122121 let module = if cfg ! ( miri) {
@@ -137,8 +136,7 @@ async fn pulley_provenance_test() -> Result<()> {
137136 results[ 2 ] = Val :: I32 ( 3 ) ;
138137 Ok ( ( ) )
139138 } ) ;
140- let instance =
141- Instance :: new_async ( & mut store, & module, & [ host_wrap. into ( ) , host_new. into ( ) ] ) . await ?;
139+ let instance = Instance :: new ( & mut store, & module, & [ host_wrap. into ( ) , host_new. into ( ) ] ) ?;
142140
143141 for func in [
144142 "call-wasm" ,
@@ -151,59 +149,53 @@ async fn pulley_provenance_test() -> Result<()> {
151149 let func = instance
152150 . get_typed_func :: < ( ) , ( i32 , i32 , i32 ) > ( & mut store, func)
153151 . unwrap ( ) ;
154- let results = func. call_async ( & mut store, ( ) ) . await ?;
152+ let results = func. call ( & mut store, ( ) ) ?;
155153 assert_eq ! ( results, ( 1 , 2 , 3 ) ) ;
156154 }
157155
158156 let funcref = instance. get_func ( & mut store, "call-wasm" ) . unwrap ( ) ;
159157 for func in [ "call_ref-wasm" , "return_call_ref-wasm" ] {
160158 println ! ( "testing func {func:?}" ) ;
161159 let func = instance. get_typed_func :: < Func , ( i32 , i32 , i32 ) > ( & mut store, func) ?;
162- let results = func. call_async ( & mut store, funcref) . await ?;
160+ let results = func. call ( & mut store, funcref) ?;
163161 assert_eq ! ( results, ( 1 , 2 , 3 ) ) ;
164162 }
165163
166164 let trap = instance
167165 . get_typed_func :: < ( ) , ( ) > ( & mut store, "unreachable" ) ?
168- . call_async ( & mut store, ( ) )
169- . await
166+ . call ( & mut store, ( ) )
170167 . unwrap_err ( )
171168 . downcast :: < Trap > ( ) ?;
172169 assert_eq ! ( trap, Trap :: UnreachableCodeReached ) ;
173170
174171 let trap = instance
175172 . get_typed_func :: < ( ) , i32 > ( & mut store, "divide-by-zero" ) ?
176- . call_async ( & mut store, ( ) )
177- . await
173+ . call ( & mut store, ( ) )
178174 . unwrap_err ( )
179175 . downcast :: < Trap > ( ) ?;
180176 assert_eq ! ( trap, Trap :: IntegerDivisionByZero ) ;
181177
182178 instance
183179 . get_typed_func :: < ( ) , ( ) > ( & mut store, "memory-intrinsics" ) ?
184- . call_async ( & mut store, ( ) )
185- . await ?;
180+ . call ( & mut store, ( ) ) ?;
186181 instance
187182 . get_typed_func :: < ( ) , ( ) > ( & mut store, "table-intrinsics" ) ?
188- . call_async ( & mut store, ( ) )
189- . await ?;
190-
191- let funcref = Func :: wrap_async ( & mut store, move |mut caller : Caller < ' _ , ( ) > , ( ) | {
192- Box :: new ( async move {
193- let func = instance. get_typed_func :: < ( ) , ( i32 , i32 , i32 ) > ( & mut caller, "call-wasm" ) ?;
194- func. call_async ( & mut caller, ( ) ) . await
195- } )
183+ . call ( & mut store, ( ) ) ?;
184+
185+ let funcref = Func :: wrap ( & mut store, move |mut caller : Caller < ' _ , ( ) > | {
186+ let func = instance. get_typed_func :: < ( ) , ( i32 , i32 , i32 ) > ( & mut caller, "call-wasm" ) ?;
187+ func. call ( & mut caller, ( ) )
196188 } ) ;
197189 let func = instance. get_typed_func :: < Func , ( i32 , i32 , i32 ) > ( & mut store, "call_ref-wasm" ) ?;
198- let results = func. call_async ( & mut store, funcref) . await ?;
190+ let results = func. call ( & mut store, funcref) ?;
199191 assert_eq ! ( results, ( 1 , 2 , 3 ) ) ;
200192
201193 Ok ( ( ) )
202194}
203195
204- #[ tokio :: test]
196+ #[ test]
205197#[ cfg_attr( miri, ignore) ]
206- async fn pulley_provenance_test_components ( ) -> Result < ( ) > {
198+ fn pulley_provenance_test_components ( ) -> Result < ( ) > {
207199 let config = provenance_test_config ( ) ;
208200 let engine = Engine :: new ( & config) ?;
209201 let component = if cfg ! ( miri) {
@@ -252,7 +244,7 @@ async fn pulley_provenance_test_components() -> Result<()> {
252244 linker
253245 . root ( )
254246 . func_wrap ( "host-list" , |_, ( value, ) : ( Vec < String > , ) | Ok ( ( value, ) ) ) ?;
255- let instance = linker. instantiate_async ( & mut store, & component) . await ?;
247+ let instance = linker. instantiate ( & mut store, & component) ?;
256248
257249 let guest_u32 = instance. get_typed_func :: < ( u32 , ) , ( u32 , ) > ( & mut store, "guest-u32" ) ?;
258250 let guest_enum = instance. get_typed_func :: < ( E , ) , ( E , ) > ( & mut store, "guest-enum" ) ?;
@@ -267,50 +259,45 @@ async fn pulley_provenance_test_components() -> Result<()> {
267259 let guest_list =
268260 instance. get_typed_func :: < ( & [ & str ] , ) , ( Vec < String > , ) > ( & mut store, "guest-list" ) ?;
269261
270- let ( result, ) = guest_u32. call_async ( & mut store, ( 42 , ) ) . await ?;
262+ let ( result, ) = guest_u32. call ( & mut store, ( 42 , ) ) ?;
271263 assert_eq ! ( result, 42 ) ;
272- guest_u32. post_return_async ( & mut store) . await ?;
264+ guest_u32. post_return ( & mut store) ?;
273265
274- let ( result, ) = guest_enum. call_async ( & mut store, ( E :: B , ) ) . await ?;
266+ let ( result, ) = guest_enum. call ( & mut store, ( E :: B , ) ) ?;
275267 assert_eq ! ( result, E :: B ) ;
276- guest_enum. post_return_async ( & mut store) . await ?;
268+ guest_enum. post_return ( & mut store) ?;
277269
278- let ( result, ) = guest_option. call_async ( & mut store, ( None , ) ) . await ?;
270+ let ( result, ) = guest_option. call ( & mut store, ( None , ) ) ?;
279271 assert_eq ! ( result, None ) ;
280- guest_option. post_return_async ( & mut store) . await ?;
281- let ( result, ) = guest_option. call_async ( & mut store, ( Some ( 200 ) , ) ) . await ?;
272+ guest_option. post_return ( & mut store) ?;
273+ let ( result, ) = guest_option. call ( & mut store, ( Some ( 200 ) , ) ) ?;
282274 assert_eq ! ( result, Some ( 200 ) ) ;
283- guest_option. post_return_async ( & mut store) . await ?;
275+ guest_option. post_return ( & mut store) ?;
284276
285- let ( result, ) = guest_result. call_async ( & mut store, ( Ok ( 10 ) , ) ) . await ?;
277+ let ( result, ) = guest_result. call ( & mut store, ( Ok ( 10 ) , ) ) ?;
286278 assert_eq ! ( result, Ok ( 10 ) ) ;
287- guest_result. post_return_async ( & mut store) . await ?;
288- let ( result, ) = guest_result
289- . call_async ( & mut store, ( Err ( i64:: MIN ) , ) )
290- . await ?;
279+ guest_result. post_return ( & mut store) ?;
280+ let ( result, ) = guest_result. call ( & mut store, ( Err ( i64:: MIN ) , ) ) ?;
291281 assert_eq ! ( result, Err ( i64 :: MIN ) ) ;
292- guest_result. post_return_async ( & mut store) . await ?;
282+ guest_result. post_return ( & mut store) ?;
293283
294- let ( result, ) = guest_string. call_async ( & mut store, ( "" , ) ) . await ?;
284+ let ( result, ) = guest_string. call ( & mut store, ( "" , ) ) ?;
295285 assert_eq ! ( result, "" ) ;
296- guest_string. post_return_async ( & mut store) . await ?;
297- let ( result, ) = guest_string. call_async ( & mut store, ( "hello" , ) ) . await ?;
286+ guest_string. post_return ( & mut store) ?;
287+ let ( result, ) = guest_string. call ( & mut store, ( "hello" , ) ) ?;
298288 assert_eq ! ( result, "hello" ) ;
299- guest_string. post_return_async ( & mut store) . await ?;
289+ guest_string. post_return ( & mut store) ?;
300290
301- let ( result, ) = guest_list. call_async ( & mut store, ( & [ ] , ) ) . await ?;
291+ let ( result, ) = guest_list. call ( & mut store, ( & [ ] , ) ) ?;
302292 assert ! ( result. is_empty( ) ) ;
303- guest_list. post_return_async ( & mut store) . await ?;
304- let ( result, ) = guest_list
305- . call_async ( & mut store, ( & [ "a" , "" , "b" , "c" ] , ) )
306- . await ?;
293+ guest_list. post_return ( & mut store) ?;
294+ let ( result, ) = guest_list. call ( & mut store, ( & [ "a" , "" , "b" , "c" ] , ) ) ?;
307295 assert_eq ! ( result, [ "a" , "" , "b" , "c" ] ) ;
308- guest_list. post_return_async ( & mut store) . await ?;
296+ guest_list. post_return ( & mut store) ?;
309297
310298 instance
311299 . get_typed_func :: < ( ) , ( ) > ( & mut store, "resource-intrinsics" ) ?
312- . call_async ( & mut store, ( ) )
313- . await ?;
300+ . call ( & mut store, ( ) ) ?;
314301 }
315302 {
316303 use wasmtime:: component:: Val ;
@@ -340,7 +327,7 @@ async fn pulley_provenance_test_components() -> Result<()> {
340327 results[ 0 ] = args[ 0 ] . clone ( ) ;
341328 Ok ( ( ) )
342329 } ) ?;
343- let instance = linker. instantiate_async ( & mut store, & component) . await ?;
330+ let instance = linker. instantiate ( & mut store, & component) ?;
344331
345332 let guest_u32 = instance. get_func ( & mut store, "guest-u32" ) . unwrap ( ) ;
346333 let guest_enum = instance. get_func ( & mut store, "guest-enum" ) . unwrap ( ) ;
@@ -350,71 +337,53 @@ async fn pulley_provenance_test_components() -> Result<()> {
350337 let guest_list = instance. get_func ( & mut store, "guest-list" ) . unwrap ( ) ;
351338
352339 let mut results = [ Val :: U32 ( 0 ) ] ;
353- guest_u32
354- . call_async ( & mut store, & [ Val :: U32 ( 42 ) ] , & mut results)
355- . await ?;
340+ guest_u32. call ( & mut store, & [ Val :: U32 ( 42 ) ] , & mut results) ?;
356341 assert_eq ! ( results[ 0 ] , Val :: U32 ( 42 ) ) ;
357- guest_u32. post_return_async ( & mut store) . await ?;
342+ guest_u32. post_return ( & mut store) ?;
358343
359- guest_enum
360- . call_async ( & mut store, & [ Val :: Enum ( "B" . into ( ) ) ] , & mut results)
361- . await ?;
344+ guest_enum. call ( & mut store, & [ Val :: Enum ( "B" . into ( ) ) ] , & mut results) ?;
362345 assert_eq ! ( results[ 0 ] , Val :: Enum ( "B" . into( ) ) ) ;
363- guest_enum. post_return_async ( & mut store) . await ?;
346+ guest_enum. post_return ( & mut store) ?;
364347
365- guest_option
366- . call_async ( & mut store, & [ Val :: Option ( None ) ] , & mut results)
367- . await ?;
348+ guest_option. call ( & mut store, & [ Val :: Option ( None ) ] , & mut results) ?;
368349 assert_eq ! ( results[ 0 ] , Val :: Option ( None ) ) ;
369- guest_option. post_return_async ( & mut store) . await ?;
370- guest_option
371- . call_async (
372- & mut store,
373- & [ Val :: Option ( Some ( Box :: new ( Val :: U8 ( 201 ) ) ) ) ] ,
374- & mut results,
375- )
376- . await ?;
350+ guest_option. post_return ( & mut store) ?;
351+ guest_option. call (
352+ & mut store,
353+ & [ Val :: Option ( Some ( Box :: new ( Val :: U8 ( 201 ) ) ) ) ] ,
354+ & mut results,
355+ ) ?;
377356 assert_eq ! ( results[ 0 ] , Val :: Option ( Some ( Box :: new( Val :: U8 ( 201 ) ) ) ) ) ;
378- guest_option. post_return_async ( & mut store) . await ?;
379-
380- guest_result
381- . call_async (
382- & mut store,
383- & [ Val :: Result ( Ok ( Some ( Box :: new ( Val :: U16 ( 20 ) ) ) ) ) ] ,
384- & mut results,
385- )
386- . await ?;
357+ guest_option. post_return ( & mut store) ?;
358+
359+ guest_result. call (
360+ & mut store,
361+ & [ Val :: Result ( Ok ( Some ( Box :: new ( Val :: U16 ( 20 ) ) ) ) ) ] ,
362+ & mut results,
363+ ) ?;
387364 assert_eq ! ( results[ 0 ] , Val :: Result ( Ok ( Some ( Box :: new( Val :: U16 ( 20 ) ) ) ) ) ) ;
388- guest_result. post_return_async ( & mut store) . await ?;
389- guest_result
390- . call_async (
391- & mut store,
392- & [ Val :: Result ( Err ( Some ( Box :: new ( Val :: S64 ( i64:: MAX ) ) ) ) ) ] ,
393- & mut results,
394- )
395- . await ?;
365+ guest_result. post_return ( & mut store) ?;
366+ guest_result. call (
367+ & mut store,
368+ & [ Val :: Result ( Err ( Some ( Box :: new ( Val :: S64 ( i64:: MAX ) ) ) ) ) ] ,
369+ & mut results,
370+ ) ?;
396371 assert_eq ! (
397372 results[ 0 ] ,
398373 Val :: Result ( Err ( Some ( Box :: new( Val :: S64 ( i64 :: MAX ) ) ) ) )
399374 ) ;
400- guest_result. post_return_async ( & mut store) . await ?;
375+ guest_result. post_return ( & mut store) ?;
401376
402- guest_string
403- . call_async ( & mut store, & [ Val :: String ( "B" . into ( ) ) ] , & mut results)
404- . await ?;
377+ guest_string. call ( & mut store, & [ Val :: String ( "B" . into ( ) ) ] , & mut results) ?;
405378 assert_eq ! ( results[ 0 ] , Val :: String ( "B" . into( ) ) ) ;
406- guest_string. post_return_async ( & mut store) . await ?;
407- guest_string
408- . call_async ( & mut store, & [ Val :: String ( "" . into ( ) ) ] , & mut results)
409- . await ?;
379+ guest_string. post_return ( & mut store) ?;
380+ guest_string. call ( & mut store, & [ Val :: String ( "" . into ( ) ) ] , & mut results) ?;
410381 assert_eq ! ( results[ 0 ] , Val :: String ( "" . into( ) ) ) ;
411- guest_string. post_return_async ( & mut store) . await ?;
382+ guest_string. post_return ( & mut store) ?;
412383
413- guest_list
414- . call_async ( & mut store, & [ Val :: List ( Vec :: new ( ) ) ] , & mut results)
415- . await ?;
384+ guest_list. call ( & mut store, & [ Val :: List ( Vec :: new ( ) ) ] , & mut results) ?;
416385 assert_eq ! ( results[ 0 ] , Val :: List ( Vec :: new( ) ) ) ;
417- guest_list. post_return_async ( & mut store) . await ?;
386+ guest_list. post_return ( & mut store) ?;
418387 }
419388
420389 Ok ( ( ) )
@@ -467,7 +436,8 @@ async fn sleep(duration: std::time::Duration) {
467436#[ tokio:: test]
468437#[ cfg_attr( miri, ignore) ]
469438async fn pulley_provenance_test_async_components ( ) -> Result < ( ) > {
470- let config = provenance_test_config ( ) ;
439+ let mut config = provenance_test_config ( ) ;
440+ config. async_support ( true ) ;
471441 let engine = Engine :: new ( & config) ?;
472442 let component = if cfg ! ( miri) {
473443 unsafe {
0 commit comments