A lightweight WebAssembly runtime that is fast, secure, and standards-compliant
deprecate `[Typed]Func::post_return[_async]` and make them no-ops (#12498)
Joel Dicec09aa38078f6
diff --git a/benches/call.rs b/benches/call.rsindex 59863d4763..7e35b7fe42 100644--- a/benches/call.rs+++ b/benches/call.rs@@ -642,11 +642,6 @@ mod component {typed.call(&mut *store, typed_params).unwrap()};assert_eq!(results, typed_results);- if is_async.use_async() {- run_await(typed.post_return_async(&mut *store)).unwrap()- } else {- typed.post_return(&mut *store).unwrap()- }})});@@ -667,11 +662,6 @@ mod component {for (expected, actual) in expected_results.iter().zip(&results) {assert_eq!(expected, actual);}- if is_async.use_async() {- run_await(untyped.post_return_async(&mut *store)).unwrap()- } else {- untyped.post_return(&mut *store).unwrap()- }})},);@@ -864,10 +854,8 @@ mod component {let start = Instant::now();if is_async.use_async() {run_await(run.call_async(&mut *store, (iters,))).unwrap();- run_await(run.post_return_async(&mut *store)).unwrap();} else {run.call(&mut *store, (iters,)).unwrap();- run.post_return(&mut *store).unwrap();}start.elapsed()})@@ -882,10 +870,8 @@ mod component {let start = Instant::now();if is_async.use_async() {run_await(run.call_async(&mut *store, (iters,))).unwrap();- run_await(run.post_return_async(&mut *store)).unwrap();} else {run.call(&mut *store, (iters,)).unwrap();- run.post_return(&mut *store).unwrap();}start.elapsed()})diff --git a/crates/c-api/include/wasmtime/component/func.h b/crates/c-api/include/wasmtime/component/func.hindex 7c871ba224..a0fd8e30ab 100644--- a/crates/c-api/include/wasmtime/component/func.h+++ b/crates/c-api/include/wasmtime/component/func.h@@ -58,12 +58,12 @@ WASM_API_EXTERN wasmtime_error_t *wasmtime_component_func_call(wasmtime_component_val_t *results, size_t results_size);/**- * \brief Invokes the `post-return` canonical ABI option, if specified, after a- * #wasmtime_component_func_call has finished.+ * \brief No longer needs to be called; this function has no effect.*- * This function is a required method call after a #wasmtime_component_func_call- * completes successfully. After the embedder has finished processing the return- * value then this function must be invoked.+ * \deprecated Previously, this invoked the `post-return` canonical ABI option,+ * if specified, after a #wasmtime_component_func_call had finished. Now that's+ * taken care of automatically as part of #wasmtime_component_func_call, so this+ * function is no longer needed, and any calls to it may be removed.*/WASM_API_EXTERN wasmtime_error_t *wasmtime_component_func_post_return(const wasmtime_component_func_t *func,diff --git a/crates/c-api/src/component/func.rs b/crates/c-api/src/component/func.rsindex 0c5fcdaae8..a540b079a7 100644--- a/crates/c-api/src/component/func.rs+++ b/crates/c-api/src/component/func.rs@@ -26,14 +26,13 @@ pub unsafe extern "C" fn wasmtime_component_func_call(})}+#[deprecated(note = "no longer has any effect")]#[unsafe(no_mangle)]pub unsafe extern "C" fn wasmtime_component_func_post_return(- func: &Func,- mut context: WasmtimeStoreContextMut<'_>,+ _func: &Func,+ _context: WasmtimeStoreContextMut<'_>,) -> Option<Box<wasmtime_error_t>> {- let result = func.post_return(&mut context);-- crate::handle_result(result, |_| {})+ None}#[unsafe(no_mangle)]diff --git a/crates/component-macro/tests/expanded/char.rs b/crates/component-macro/tests/expanded/char.rsindex 273780c38b..a5b7d1bedb 100644--- a/crates/component-macro/tests/expanded/char.rs+++ b/crates/component-macro/tests/expanded/char.rs@@ -334,7 +334,6 @@ pub mod exports {>::new_unchecked(self.take_char)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}/// A function that returns a character@@ -349,7 +348,6 @@ pub mod exports {>::new_unchecked(self.return_char)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/char_async.rs b/crates/component-macro/tests/expanded/char_async.rsindex 4dd42e6782..8d454304c5 100644--- a/crates/component-macro/tests/expanded/char_async.rs+++ b/crates/component-macro/tests/expanded/char_async.rs@@ -353,7 +353,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}/// A function that returns a character@@ -373,7 +372,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/char_tracing_async.rs b/crates/component-macro/tests/expanded/char_tracing_async.rsindex 19835e7fd9..6d69397a3b 100644--- a/crates/component-macro/tests/expanded/char_tracing_async.rs+++ b/crates/component-macro/tests/expanded/char_tracing_async.rs@@ -388,10 +388,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}/// A function that returns a character@@ -417,10 +413,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/conventions.rs b/crates/component-macro/tests/expanded/conventions.rsindex a623593be4..4bc40a0e36 100644--- a/crates/component-macro/tests/expanded/conventions.rs+++ b/crates/component-macro/tests/expanded/conventions.rs@@ -626,7 +626,6 @@ pub mod exports {>::new_unchecked(self.kebab_case)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_foo<S: wasmtime::AsContextMut>(@@ -641,7 +640,6 @@ pub mod exports {>::new_unchecked(self.foo)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_function_with_dashes<S: wasmtime::AsContextMut>(@@ -655,7 +653,6 @@ pub mod exports {>::new_unchecked(self.function_with_dashes)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_function_with_no_weird_characters<@@ -668,7 +665,6 @@ pub mod exports {>::new_unchecked(self.function_with_no_weird_characters)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_apple<S: wasmtime::AsContextMut>(@@ -682,7 +678,6 @@ pub mod exports {>::new_unchecked(self.apple)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_apple_pear<S: wasmtime::AsContextMut>(@@ -696,7 +691,6 @@ pub mod exports {>::new_unchecked(self.apple_pear)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_apple_pear_grape<S: wasmtime::AsContextMut>(@@ -710,7 +704,6 @@ pub mod exports {>::new_unchecked(self.apple_pear_grape)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_a0<S: wasmtime::AsContextMut>(@@ -724,7 +717,6 @@ pub mod exports {>::new_unchecked(self.a0)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}/// Comment out identifiers that collide when mapped to snake_case, for now; see@@ -743,7 +735,6 @@ pub mod exports {>::new_unchecked(self.is_xml)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_explicit<S: wasmtime::AsContextMut>(@@ -757,7 +748,6 @@ pub mod exports {>::new_unchecked(self.explicit)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_explicit_kebab<S: wasmtime::AsContextMut>(@@ -771,7 +761,6 @@ pub mod exports {>::new_unchecked(self.explicit_kebab)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}/// Identifiers with the same name as keywords are quoted.@@ -786,7 +775,6 @@ pub mod exports {>::new_unchecked(self.bool)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/conventions_async.rs b/crates/component-macro/tests/expanded/conventions_async.rsindex cf55278a69..1167d35754 100644--- a/crates/component-macro/tests/expanded/conventions_async.rs+++ b/crates/component-macro/tests/expanded/conventions_async.rs@@ -687,7 +687,6 @@ pub mod exports {>::new_unchecked(self.kebab_case)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_foo<S: wasmtime::AsContextMut>(@@ -707,7 +706,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_function_with_dashes<S: wasmtime::AsContextMut>(@@ -724,7 +722,6 @@ pub mod exports {>::new_unchecked(self.function_with_dashes)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_function_with_no_weird_characters<@@ -740,7 +737,6 @@ pub mod exports {>::new_unchecked(self.function_with_no_weird_characters)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_apple<S: wasmtime::AsContextMut>(@@ -757,7 +753,6 @@ pub mod exports {>::new_unchecked(self.apple)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_apple_pear<S: wasmtime::AsContextMut>(@@ -774,7 +769,6 @@ pub mod exports {>::new_unchecked(self.apple_pear)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_apple_pear_grape<S: wasmtime::AsContextMut>(@@ -791,7 +785,6 @@ pub mod exports {>::new_unchecked(self.apple_pear_grape)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_a0<S: wasmtime::AsContextMut>(@@ -808,7 +801,6 @@ pub mod exports {>::new_unchecked(self.a0)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}/// Comment out identifiers that collide when mapped to snake_case, for now; see@@ -830,7 +822,6 @@ pub mod exports {>::new_unchecked(self.is_xml)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_explicit<S: wasmtime::AsContextMut>(@@ -847,7 +838,6 @@ pub mod exports {>::new_unchecked(self.explicit)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_explicit_kebab<S: wasmtime::AsContextMut>(@@ -864,7 +854,6 @@ pub mod exports {>::new_unchecked(self.explicit_kebab)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}/// Identifiers with the same name as keywords are quoted.@@ -882,7 +871,6 @@ pub mod exports {>::new_unchecked(self.bool)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/conventions_tracing_async.rs b/crates/component-macro/tests/expanded/conventions_tracing_async.rsindex 516a50f58e..ad8d5d0083 100644--- a/crates/component-macro/tests/expanded/conventions_tracing_async.rs+++ b/crates/component-macro/tests/expanded/conventions_tracing_async.rs@@ -855,10 +855,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_foo<S: wasmtime::AsContextMut>(@@ -884,10 +880,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_function_with_dashes<S: wasmtime::AsContextMut>(@@ -912,10 +904,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_function_with_no_weird_characters<@@ -940,10 +928,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_apple<S: wasmtime::AsContextMut>(@@ -968,10 +952,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_apple_pear<S: wasmtime::AsContextMut>(@@ -996,10 +976,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_apple_pear_grape<S: wasmtime::AsContextMut>(@@ -1024,10 +1000,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_a0<S: wasmtime::AsContextMut>(@@ -1052,10 +1024,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}/// Comment out identifiers that collide when mapped to snake_case, for now; see@@ -1085,10 +1053,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_explicit<S: wasmtime::AsContextMut>(@@ -1113,10 +1077,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_explicit_kebab<S: wasmtime::AsContextMut>(@@ -1141,10 +1101,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}/// Identifiers with the same name as keywords are quoted.@@ -1170,10 +1126,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/flags.rs b/crates/component-macro/tests/expanded/flags.rsindex 4b7150019c..83618cb4ea 100644--- a/crates/component-macro/tests/expanded/flags.rs+++ b/crates/component-macro/tests/expanded/flags.rs@@ -731,7 +731,6 @@ pub mod exports {>::new_unchecked(self.roundtrip_flag1)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_roundtrip_flag2<S: wasmtime::AsContextMut>(@@ -746,7 +745,6 @@ pub mod exports {>::new_unchecked(self.roundtrip_flag2)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_roundtrip_flag4<S: wasmtime::AsContextMut>(@@ -761,7 +759,6 @@ pub mod exports {>::new_unchecked(self.roundtrip_flag4)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_roundtrip_flag8<S: wasmtime::AsContextMut>(@@ -776,7 +773,6 @@ pub mod exports {>::new_unchecked(self.roundtrip_flag8)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_roundtrip_flag16<S: wasmtime::AsContextMut>(@@ -791,7 +787,6 @@ pub mod exports {>::new_unchecked(self.roundtrip_flag16)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_roundtrip_flag32<S: wasmtime::AsContextMut>(@@ -806,7 +801,6 @@ pub mod exports {>::new_unchecked(self.roundtrip_flag32)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_roundtrip_flag64<S: wasmtime::AsContextMut>(@@ -821,7 +815,6 @@ pub mod exports {>::new_unchecked(self.roundtrip_flag64)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/flags_async.rs b/crates/component-macro/tests/expanded/flags_async.rsindex 8b263ef392..9d0e0fcb92 100644--- a/crates/component-macro/tests/expanded/flags_async.rs+++ b/crates/component-macro/tests/expanded/flags_async.rs@@ -792,7 +792,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_roundtrip_flag2<S: wasmtime::AsContextMut>(@@ -812,7 +811,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_roundtrip_flag4<S: wasmtime::AsContextMut>(@@ -832,7 +830,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_roundtrip_flag8<S: wasmtime::AsContextMut>(@@ -852,7 +849,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_roundtrip_flag16<S: wasmtime::AsContextMut>(@@ -872,7 +868,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_roundtrip_flag32<S: wasmtime::AsContextMut>(@@ -892,7 +887,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_roundtrip_flag64<S: wasmtime::AsContextMut>(@@ -912,7 +906,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/flags_tracing_async.rs b/crates/component-macro/tests/expanded/flags_tracing_async.rsindex f5dc442560..adbd44dc04 100644--- a/crates/component-macro/tests/expanded/flags_tracing_async.rs+++ b/crates/component-macro/tests/expanded/flags_tracing_async.rs@@ -910,10 +910,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_roundtrip_flag2<S: wasmtime::AsContextMut>(@@ -939,10 +935,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_roundtrip_flag4<S: wasmtime::AsContextMut>(@@ -968,10 +960,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_roundtrip_flag8<S: wasmtime::AsContextMut>(@@ -997,10 +985,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_roundtrip_flag16<S: wasmtime::AsContextMut>(@@ -1026,10 +1010,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_roundtrip_flag32<S: wasmtime::AsContextMut>(@@ -1055,10 +1035,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_roundtrip_flag64<S: wasmtime::AsContextMut>(@@ -1084,10 +1060,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/floats.rs b/crates/component-macro/tests/expanded/floats.rsindex a41e1425d0..f1a8fa975d 100644--- a/crates/component-macro/tests/expanded/floats.rs+++ b/crates/component-macro/tests/expanded/floats.rs@@ -368,7 +368,6 @@ pub mod exports {>::new_unchecked(self.f32_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_f64_param<S: wasmtime::AsContextMut>(@@ -383,7 +382,6 @@ pub mod exports {>::new_unchecked(self.f64_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_f32_result<S: wasmtime::AsContextMut>(@@ -397,7 +395,6 @@ pub mod exports {>::new_unchecked(self.f32_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_f64_result<S: wasmtime::AsContextMut>(@@ -411,7 +408,6 @@ pub mod exports {>::new_unchecked(self.f64_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/floats_async.rs b/crates/component-macro/tests/expanded/floats_async.rsindex f977c62c47..7eb5265734 100644--- a/crates/component-macro/tests/expanded/floats_async.rs+++ b/crates/component-macro/tests/expanded/floats_async.rs@@ -401,7 +401,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_f64_param<S: wasmtime::AsContextMut>(@@ -421,7 +420,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_f32_result<S: wasmtime::AsContextMut>(@@ -440,7 +438,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_f64_result<S: wasmtime::AsContextMut>(@@ -459,7 +456,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/floats_tracing_async.rs b/crates/component-macro/tests/expanded/floats_tracing_async.rsindex 63c8ed1bb6..685d2074d5 100644--- a/crates/component-macro/tests/expanded/floats_tracing_async.rs+++ b/crates/component-macro/tests/expanded/floats_tracing_async.rs@@ -465,10 +465,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_f64_param<S: wasmtime::AsContextMut>(@@ -494,10 +490,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_f32_result<S: wasmtime::AsContextMut>(@@ -522,10 +514,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_f64_result<S: wasmtime::AsContextMut>(@@ -550,10 +538,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/function-new.rs b/crates/component-macro/tests/expanded/function-new.rsindex 8ccbaa0412..0072bef345 100644--- a/crates/component-macro/tests/expanded/function-new.rs+++ b/crates/component-macro/tests/expanded/function-new.rs@@ -188,7 +188,6 @@ const _: () = {wasmtime::component::TypedFunc::<(), ()>::new_unchecked(self.new)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/function-new_async.rs b/crates/component-macro/tests/expanded/function-new_async.rsindex 3fe487f070..44af5dc744 100644--- a/crates/component-macro/tests/expanded/function-new_async.rs+++ b/crates/component-macro/tests/expanded/function-new_async.rs@@ -191,7 +191,6 @@ const _: () = {wasmtime::component::TypedFunc::<(), ()>::new_unchecked(self.new)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/function-new_tracing_async.rs b/crates/component-macro/tests/expanded/function-new_tracing_async.rsindex 46563e6308..5e30aca2a0 100644--- a/crates/component-macro/tests/expanded/function-new_tracing_async.rs+++ b/crates/component-macro/tests/expanded/function-new_tracing_async.rs@@ -199,7 +199,6 @@ const _: () = {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee.post_return_async(store.as_context_mut()).instrument(span).await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/integers.rs b/crates/component-macro/tests/expanded/integers.rsindex 9498a81ccf..295860b8ef 100644--- a/crates/component-macro/tests/expanded/integers.rs+++ b/crates/component-macro/tests/expanded/integers.rs@@ -696,7 +696,6 @@ pub mod exports {>::new_unchecked(self.a1)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_a2<S: wasmtime::AsContextMut>(@@ -711,7 +710,6 @@ pub mod exports {>::new_unchecked(self.a2)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_a3<S: wasmtime::AsContextMut>(@@ -726,7 +724,6 @@ pub mod exports {>::new_unchecked(self.a3)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_a4<S: wasmtime::AsContextMut>(@@ -741,7 +738,6 @@ pub mod exports {>::new_unchecked(self.a4)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_a5<S: wasmtime::AsContextMut>(@@ -756,7 +752,6 @@ pub mod exports {>::new_unchecked(self.a5)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_a6<S: wasmtime::AsContextMut>(@@ -771,7 +766,6 @@ pub mod exports {>::new_unchecked(self.a6)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_a7<S: wasmtime::AsContextMut>(@@ -786,7 +780,6 @@ pub mod exports {>::new_unchecked(self.a7)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_a8<S: wasmtime::AsContextMut>(@@ -801,7 +794,6 @@ pub mod exports {>::new_unchecked(self.a8)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_a9<S: wasmtime::AsContextMut>(@@ -827,7 +819,6 @@ pub mod exports {store.as_context_mut(),(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7),)?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_r1<S: wasmtime::AsContextMut>(@@ -841,7 +832,6 @@ pub mod exports {>::new_unchecked(self.r1)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_r2<S: wasmtime::AsContextMut>(@@ -855,7 +845,6 @@ pub mod exports {>::new_unchecked(self.r2)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_r3<S: wasmtime::AsContextMut>(@@ -869,7 +858,6 @@ pub mod exports {>::new_unchecked(self.r3)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_r4<S: wasmtime::AsContextMut>(@@ -883,7 +871,6 @@ pub mod exports {>::new_unchecked(self.r4)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_r5<S: wasmtime::AsContextMut>(@@ -897,7 +884,6 @@ pub mod exports {>::new_unchecked(self.r5)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_r6<S: wasmtime::AsContextMut>(@@ -911,7 +897,6 @@ pub mod exports {>::new_unchecked(self.r6)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_r7<S: wasmtime::AsContextMut>(@@ -925,7 +910,6 @@ pub mod exports {>::new_unchecked(self.r7)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_r8<S: wasmtime::AsContextMut>(@@ -939,7 +923,6 @@ pub mod exports {>::new_unchecked(self.r8)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_pair_ret<S: wasmtime::AsContextMut>(@@ -953,7 +936,6 @@ pub mod exports {>::new_unchecked(self.pair_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/integers_async.rs b/crates/component-macro/tests/expanded/integers_async.rsindex 016aa0fc40..db1617f4c4 100644--- a/crates/component-macro/tests/expanded/integers_async.rs+++ b/crates/component-macro/tests/expanded/integers_async.rs@@ -790,7 +790,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_a2<S: wasmtime::AsContextMut>(@@ -810,7 +809,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_a3<S: wasmtime::AsContextMut>(@@ -830,7 +828,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_a4<S: wasmtime::AsContextMut>(@@ -850,7 +847,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_a5<S: wasmtime::AsContextMut>(@@ -870,7 +866,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_a6<S: wasmtime::AsContextMut>(@@ -890,7 +885,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_a7<S: wasmtime::AsContextMut>(@@ -910,7 +904,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_a8<S: wasmtime::AsContextMut>(@@ -930,7 +923,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_a9<S: wasmtime::AsContextMut>(@@ -960,7 +952,6 @@ pub mod exports {(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7),).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_r1<S: wasmtime::AsContextMut>(@@ -979,7 +970,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_r2<S: wasmtime::AsContextMut>(@@ -998,7 +988,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_r3<S: wasmtime::AsContextMut>(@@ -1017,7 +1006,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_r4<S: wasmtime::AsContextMut>(@@ -1036,7 +1024,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_r5<S: wasmtime::AsContextMut>(@@ -1055,7 +1042,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_r6<S: wasmtime::AsContextMut>(@@ -1074,7 +1060,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_r7<S: wasmtime::AsContextMut>(@@ -1093,7 +1078,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_r8<S: wasmtime::AsContextMut>(@@ -1112,7 +1096,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_pair_ret<S: wasmtime::AsContextMut>(@@ -1131,7 +1114,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/integers_tracing_async.rs b/crates/component-macro/tests/expanded/integers_tracing_async.rsindex 15093f08d7..bf7da53520 100644--- a/crates/component-macro/tests/expanded/integers_tracing_async.rs+++ b/crates/component-macro/tests/expanded/integers_tracing_async.rs@@ -1061,10 +1061,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_a2<S: wasmtime::AsContextMut>(@@ -1090,10 +1086,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_a3<S: wasmtime::AsContextMut>(@@ -1119,10 +1111,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_a4<S: wasmtime::AsContextMut>(@@ -1148,10 +1136,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_a5<S: wasmtime::AsContextMut>(@@ -1177,10 +1161,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_a6<S: wasmtime::AsContextMut>(@@ -1206,10 +1186,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_a7<S: wasmtime::AsContextMut>(@@ -1235,10 +1211,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_a8<S: wasmtime::AsContextMut>(@@ -1264,10 +1236,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_a9<S: wasmtime::AsContextMut>(@@ -1303,10 +1271,6 @@ pub mod exports {).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_r1<S: wasmtime::AsContextMut>(@@ -1331,10 +1295,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_r2<S: wasmtime::AsContextMut>(@@ -1359,10 +1319,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_r3<S: wasmtime::AsContextMut>(@@ -1387,10 +1343,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_r4<S: wasmtime::AsContextMut>(@@ -1415,10 +1367,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_r5<S: wasmtime::AsContextMut>(@@ -1443,10 +1391,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_r6<S: wasmtime::AsContextMut>(@@ -1471,10 +1415,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_r7<S: wasmtime::AsContextMut>(@@ -1499,10 +1439,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_r8<S: wasmtime::AsContextMut>(@@ -1527,10 +1463,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_pair_ret<S: wasmtime::AsContextMut>(@@ -1555,10 +1487,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/lists.rs b/crates/component-macro/tests/expanded/lists.rsindex 51800bae0f..613735361d 100644--- a/crates/component-macro/tests/expanded/lists.rs+++ b/crates/component-macro/tests/expanded/lists.rs@@ -1553,7 +1553,6 @@ pub mod exports {>::new_unchecked(self.list_u8_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_list_u16_param<S: wasmtime::AsContextMut>(@@ -1568,7 +1567,6 @@ pub mod exports {>::new_unchecked(self.list_u16_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_list_u32_param<S: wasmtime::AsContextMut>(@@ -1583,7 +1581,6 @@ pub mod exports {>::new_unchecked(self.list_u32_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_list_u64_param<S: wasmtime::AsContextMut>(@@ -1598,7 +1595,6 @@ pub mod exports {>::new_unchecked(self.list_u64_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_list_s8_param<S: wasmtime::AsContextMut>(@@ -1613,7 +1609,6 @@ pub mod exports {>::new_unchecked(self.list_s8_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_list_s16_param<S: wasmtime::AsContextMut>(@@ -1628,7 +1623,6 @@ pub mod exports {>::new_unchecked(self.list_s16_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_list_s32_param<S: wasmtime::AsContextMut>(@@ -1643,7 +1637,6 @@ pub mod exports {>::new_unchecked(self.list_s32_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_list_s64_param<S: wasmtime::AsContextMut>(@@ -1658,7 +1651,6 @@ pub mod exports {>::new_unchecked(self.list_s64_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_list_f32_param<S: wasmtime::AsContextMut>(@@ -1673,7 +1665,6 @@ pub mod exports {>::new_unchecked(self.list_f32_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_list_f64_param<S: wasmtime::AsContextMut>(@@ -1688,7 +1679,6 @@ pub mod exports {>::new_unchecked(self.list_f64_param)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_list_u8_ret<S: wasmtime::AsContextMut>(@@ -1702,7 +1692,6 @@ pub mod exports {>::new_unchecked(self.list_u8_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_list_u16_ret<S: wasmtime::AsContextMut>(@@ -1716,7 +1705,6 @@ pub mod exports {>::new_unchecked(self.list_u16_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_list_u32_ret<S: wasmtime::AsContextMut>(@@ -1730,7 +1718,6 @@ pub mod exports {>::new_unchecked(self.list_u32_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_list_u64_ret<S: wasmtime::AsContextMut>(@@ -1744,7 +1731,6 @@ pub mod exports {>::new_unchecked(self.list_u64_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_list_s8_ret<S: wasmtime::AsContextMut>(@@ -1758,7 +1744,6 @@ pub mod exports {>::new_unchecked(self.list_s8_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_list_s16_ret<S: wasmtime::AsContextMut>(@@ -1772,7 +1757,6 @@ pub mod exports {>::new_unchecked(self.list_s16_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_list_s32_ret<S: wasmtime::AsContextMut>(@@ -1786,7 +1770,6 @@ pub mod exports {>::new_unchecked(self.list_s32_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_list_s64_ret<S: wasmtime::AsContextMut>(@@ -1800,7 +1783,6 @@ pub mod exports {>::new_unchecked(self.list_s64_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_list_f32_ret<S: wasmtime::AsContextMut>(@@ -1814,7 +1796,6 @@ pub mod exports {>::new_unchecked(self.list_f32_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_list_f64_ret<S: wasmtime::AsContextMut>(@@ -1828,7 +1809,6 @@ pub mod exports {>::new_unchecked(self.list_f64_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_tuple_list<S: wasmtime::AsContextMut>(@@ -1845,7 +1825,6 @@ pub mod exports {>::new_unchecked(self.tuple_list)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_string_list_arg<S: wasmtime::AsContextMut>(@@ -1860,7 +1839,6 @@ pub mod exports {>::new_unchecked(self.string_list_arg)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_string_list_ret<S: wasmtime::AsContextMut>(@@ -1882,7 +1860,6 @@ pub mod exports {>::new_unchecked(self.string_list_ret)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_tuple_string_list<S: wasmtime::AsContextMut>(@@ -1905,7 +1882,6 @@ pub mod exports {>::new_unchecked(self.tuple_string_list)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_string_list<S: wasmtime::AsContextMut>(@@ -1928,7 +1904,6 @@ pub mod exports {>::new_unchecked(self.string_list)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_record_list<S: wasmtime::AsContextMut>(@@ -1945,7 +1920,6 @@ pub mod exports {>::new_unchecked(self.record_list)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_record_list_reverse<S: wasmtime::AsContextMut>(@@ -1962,7 +1936,6 @@ pub mod exports {>::new_unchecked(self.record_list_reverse)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_variant_list<S: wasmtime::AsContextMut>(@@ -1979,7 +1952,6 @@ pub mod exports {>::new_unchecked(self.variant_list)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_load_store_everything<S: wasmtime::AsContextMut>(@@ -1994,7 +1966,6 @@ pub mod exports {>::new_unchecked(self.load_store_everything)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/lists_async.rs b/crates/component-macro/tests/expanded/lists_async.rsindex fdb896fdcd..3f7866b3b7 100644--- a/crates/component-macro/tests/expanded/lists_async.rs+++ b/crates/component-macro/tests/expanded/lists_async.rs@@ -1724,7 +1724,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_list_u16_param<S: wasmtime::AsContextMut>(@@ -1744,7 +1743,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_list_u32_param<S: wasmtime::AsContextMut>(@@ -1764,7 +1762,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_list_u64_param<S: wasmtime::AsContextMut>(@@ -1784,7 +1781,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_list_s8_param<S: wasmtime::AsContextMut>(@@ -1804,7 +1800,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_list_s16_param<S: wasmtime::AsContextMut>(@@ -1824,7 +1819,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_list_s32_param<S: wasmtime::AsContextMut>(@@ -1844,7 +1838,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_list_s64_param<S: wasmtime::AsContextMut>(@@ -1864,7 +1857,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_list_f32_param<S: wasmtime::AsContextMut>(@@ -1884,7 +1876,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_list_f64_param<S: wasmtime::AsContextMut>(@@ -1904,7 +1895,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_list_u8_ret<S: wasmtime::AsContextMut>(@@ -1923,7 +1913,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_list_u16_ret<S: wasmtime::AsContextMut>(@@ -1942,7 +1931,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_list_u32_ret<S: wasmtime::AsContextMut>(@@ -1961,7 +1949,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_list_u64_ret<S: wasmtime::AsContextMut>(@@ -1980,7 +1967,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_list_s8_ret<S: wasmtime::AsContextMut>(@@ -1999,7 +1985,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_list_s16_ret<S: wasmtime::AsContextMut>(@@ -2018,7 +2003,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_list_s32_ret<S: wasmtime::AsContextMut>(@@ -2037,7 +2021,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_list_s64_ret<S: wasmtime::AsContextMut>(@@ -2056,7 +2039,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_list_f32_ret<S: wasmtime::AsContextMut>(@@ -2075,7 +2057,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_list_f64_ret<S: wasmtime::AsContextMut>(@@ -2094,7 +2075,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_tuple_list<S: wasmtime::AsContextMut>(@@ -2116,7 +2096,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_string_list_arg<S: wasmtime::AsContextMut>(@@ -2136,7 +2115,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_string_list_ret<S: wasmtime::AsContextMut>(@@ -2163,7 +2141,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_tuple_string_list<S: wasmtime::AsContextMut>(@@ -2191,7 +2168,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_string_list<S: wasmtime::AsContextMut>(@@ -2219,7 +2195,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_record_list<S: wasmtime::AsContextMut>(@@ -2241,7 +2216,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_record_list_reverse<S: wasmtime::AsContextMut>(@@ -2263,7 +2237,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_variant_list<S: wasmtime::AsContextMut>(@@ -2285,7 +2258,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_load_store_everything<S: wasmtime::AsContextMut>(@@ -2305,7 +2277,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/lists_tracing_async.rs b/crates/component-macro/tests/expanded/lists_tracing_async.rsindex 5dc0cfbd47..c2b5f0c04b 100644--- a/crates/component-macro/tests/expanded/lists_tracing_async.rs+++ b/crates/component-macro/tests/expanded/lists_tracing_async.rs@@ -2161,10 +2161,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_list_u16_param<S: wasmtime::AsContextMut>(@@ -2190,10 +2186,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_list_u32_param<S: wasmtime::AsContextMut>(@@ -2219,10 +2211,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_list_u64_param<S: wasmtime::AsContextMut>(@@ -2248,10 +2236,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_list_s8_param<S: wasmtime::AsContextMut>(@@ -2277,10 +2261,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_list_s16_param<S: wasmtime::AsContextMut>(@@ -2306,10 +2286,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_list_s32_param<S: wasmtime::AsContextMut>(@@ -2335,10 +2311,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_list_s64_param<S: wasmtime::AsContextMut>(@@ -2364,10 +2336,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_list_f32_param<S: wasmtime::AsContextMut>(@@ -2393,10 +2361,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_list_f64_param<S: wasmtime::AsContextMut>(@@ -2422,10 +2386,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_list_u8_ret<S: wasmtime::AsContextMut>(@@ -2450,10 +2410,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_list_u16_ret<S: wasmtime::AsContextMut>(@@ -2478,10 +2434,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_list_u32_ret<S: wasmtime::AsContextMut>(@@ -2506,10 +2458,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_list_u64_ret<S: wasmtime::AsContextMut>(@@ -2534,10 +2482,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_list_s8_ret<S: wasmtime::AsContextMut>(@@ -2562,10 +2506,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_list_s16_ret<S: wasmtime::AsContextMut>(@@ -2590,10 +2530,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_list_s32_ret<S: wasmtime::AsContextMut>(@@ -2618,10 +2554,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_list_s64_ret<S: wasmtime::AsContextMut>(@@ -2646,10 +2578,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_list_f32_ret<S: wasmtime::AsContextMut>(@@ -2674,10 +2602,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_list_f64_ret<S: wasmtime::AsContextMut>(@@ -2702,10 +2626,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_tuple_list<S: wasmtime::AsContextMut>(@@ -2733,10 +2653,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_string_list_arg<S: wasmtime::AsContextMut>(@@ -2762,10 +2678,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_string_list_ret<S: wasmtime::AsContextMut>(@@ -2798,10 +2710,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_tuple_string_list<S: wasmtime::AsContextMut>(@@ -2835,10 +2743,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_string_list<S: wasmtime::AsContextMut>(@@ -2872,10 +2776,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_record_list<S: wasmtime::AsContextMut>(@@ -2903,10 +2803,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_record_list_reverse<S: wasmtime::AsContextMut>(@@ -2934,10 +2830,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_variant_list<S: wasmtime::AsContextMut>(@@ -2965,10 +2857,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_load_store_everything<S: wasmtime::AsContextMut>(@@ -2994,10 +2882,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/many-arguments.rs b/crates/component-macro/tests/expanded/many-arguments.rsindex 1c18b77b25..69ee064a79 100644--- a/crates/component-macro/tests/expanded/many-arguments.rs+++ b/crates/component-macro/tests/expanded/many-arguments.rs@@ -679,7 +679,6 @@ pub mod exports {arg15,),)?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_big_argument<S: wasmtime::AsContextMut>(@@ -694,7 +693,6 @@ pub mod exports {>::new_unchecked(self.big_argument)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/many-arguments_async.rs b/crates/component-macro/tests/expanded/many-arguments_async.rsindex 4d9700235c..5657799da7 100644--- a/crates/component-macro/tests/expanded/many-arguments_async.rs+++ b/crates/component-macro/tests/expanded/many-arguments_async.rs@@ -697,7 +697,6 @@ pub mod exports {),).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_big_argument<S: wasmtime::AsContextMut>(@@ -717,7 +716,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/many-arguments_tracing_async.rs b/crates/component-macro/tests/expanded/many-arguments_tracing_async.rsindex 0e5049be7d..bae7812bc3 100644--- a/crates/component-macro/tests/expanded/many-arguments_tracing_async.rs+++ b/crates/component-macro/tests/expanded/many-arguments_tracing_async.rs@@ -746,10 +746,6 @@ pub mod exports {).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_big_argument<S: wasmtime::AsContextMut>(@@ -775,10 +771,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/multiversion.rs b/crates/component-macro/tests/expanded/multiversion.rsindex ab9291731c..3e60b5ebb4 100644--- a/crates/component-macro/tests/expanded/multiversion.rs+++ b/crates/component-macro/tests/expanded/multiversion.rs@@ -352,7 +352,6 @@ pub mod exports {>::new_unchecked(self.x)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}}@@ -432,7 +431,6 @@ pub mod exports {>::new_unchecked(self.x)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/multiversion_async.rs b/crates/component-macro/tests/expanded/multiversion_async.rsindex 7774844f2b..ead3b04e96 100644--- a/crates/component-macro/tests/expanded/multiversion_async.rs+++ b/crates/component-macro/tests/expanded/multiversion_async.rs@@ -359,7 +359,6 @@ pub mod exports {>::new_unchecked(self.x)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}}@@ -442,7 +441,6 @@ pub mod exports {>::new_unchecked(self.x)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/multiversion_tracing_async.rs b/crates/component-macro/tests/expanded/multiversion_tracing_async.rsindex 3935f76f3c..f8c6d25571 100644--- a/crates/component-macro/tests/expanded/multiversion_tracing_async.rs+++ b/crates/component-macro/tests/expanded/multiversion_tracing_async.rs@@ -393,10 +393,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}}@@ -487,10 +483,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/records.rs b/crates/component-macro/tests/expanded/records.rsindex 0ad1a56b86..fe82efb4a2 100644--- a/crates/component-macro/tests/expanded/records.rs+++ b/crates/component-macro/tests/expanded/records.rs@@ -895,7 +895,6 @@ pub mod exports {>::new_unchecked(self.tuple_arg)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_tuple_result<S: wasmtime::AsContextMut>(@@ -909,7 +908,6 @@ pub mod exports {>::new_unchecked(self.tuple_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_empty_arg<S: wasmtime::AsContextMut>(@@ -924,7 +922,6 @@ pub mod exports {>::new_unchecked(self.empty_arg)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_empty_result<S: wasmtime::AsContextMut>(@@ -938,7 +935,6 @@ pub mod exports {>::new_unchecked(self.empty_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_scalar_arg<S: wasmtime::AsContextMut>(@@ -953,7 +949,6 @@ pub mod exports {>::new_unchecked(self.scalar_arg)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_scalar_result<S: wasmtime::AsContextMut>(@@ -967,7 +962,6 @@ pub mod exports {>::new_unchecked(self.scalar_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_flags_arg<S: wasmtime::AsContextMut>(@@ -982,7 +976,6 @@ pub mod exports {>::new_unchecked(self.flags_arg)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_flags_result<S: wasmtime::AsContextMut>(@@ -996,7 +989,6 @@ pub mod exports {>::new_unchecked(self.flags_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_aggregate_arg<S: wasmtime::AsContextMut>(@@ -1011,7 +1003,6 @@ pub mod exports {>::new_unchecked(self.aggregate_arg)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_aggregate_result<S: wasmtime::AsContextMut>(@@ -1025,7 +1016,6 @@ pub mod exports {>::new_unchecked(self.aggregate_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_typedef_inout<S: wasmtime::AsContextMut>(@@ -1040,7 +1030,6 @@ pub mod exports {>::new_unchecked(self.typedef_inout)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/records_async.rs b/crates/component-macro/tests/expanded/records_async.rsindex d9864b7058..4453813966 100644--- a/crates/component-macro/tests/expanded/records_async.rs+++ b/crates/component-macro/tests/expanded/records_async.rs@@ -978,7 +978,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_tuple_result<S: wasmtime::AsContextMut>(@@ -997,7 +996,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_empty_arg<S: wasmtime::AsContextMut>(@@ -1017,7 +1015,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_empty_result<S: wasmtime::AsContextMut>(@@ -1036,7 +1033,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_scalar_arg<S: wasmtime::AsContextMut>(@@ -1056,7 +1052,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_scalar_result<S: wasmtime::AsContextMut>(@@ -1075,7 +1070,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_flags_arg<S: wasmtime::AsContextMut>(@@ -1095,7 +1089,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_flags_result<S: wasmtime::AsContextMut>(@@ -1114,7 +1107,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_aggregate_arg<S: wasmtime::AsContextMut>(@@ -1134,7 +1126,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_aggregate_result<S: wasmtime::AsContextMut>(@@ -1153,7 +1144,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_typedef_inout<S: wasmtime::AsContextMut>(@@ -1173,7 +1163,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/records_tracing_async.rs b/crates/component-macro/tests/expanded/records_tracing_async.rsindex 9a45e17af3..dd8846d8e9 100644--- a/crates/component-macro/tests/expanded/records_tracing_async.rs+++ b/crates/component-macro/tests/expanded/records_tracing_async.rs@@ -1145,10 +1145,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_tuple_result<S: wasmtime::AsContextMut>(@@ -1173,10 +1169,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_empty_arg<S: wasmtime::AsContextMut>(@@ -1202,10 +1194,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_empty_result<S: wasmtime::AsContextMut>(@@ -1230,10 +1218,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_scalar_arg<S: wasmtime::AsContextMut>(@@ -1259,10 +1243,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_scalar_result<S: wasmtime::AsContextMut>(@@ -1287,10 +1267,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_flags_arg<S: wasmtime::AsContextMut>(@@ -1316,10 +1292,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_flags_result<S: wasmtime::AsContextMut>(@@ -1344,10 +1316,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_aggregate_arg<S: wasmtime::AsContextMut>(@@ -1373,10 +1341,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_aggregate_result<S: wasmtime::AsContextMut>(@@ -1401,10 +1365,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_typedef_inout<S: wasmtime::AsContextMut>(@@ -1430,10 +1390,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/resources-export.rs b/crates/component-macro/tests/expanded/resources-export.rsindex 45f5d523e4..1ea10ab962 100644--- a/crates/component-macro/tests/expanded/resources-export.rs+++ b/crates/component-macro/tests/expanded/resources-export.rs@@ -398,7 +398,6 @@ pub mod exports {>::new_unchecked(self.funcs.constructor_a_constructor)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_static_a<S: wasmtime::AsContextMut>(@@ -412,7 +411,6 @@ pub mod exports {>::new_unchecked(self.funcs.static_a_static_a)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_method_a<S: wasmtime::AsContextMut>(@@ -427,7 +425,6 @@ pub mod exports {>::new_unchecked(self.funcs.method_a_method_a)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}@@ -548,7 +545,6 @@ pub mod exports {>::new_unchecked(self.funcs.constructor_a_constructor)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_static_a<S: wasmtime::AsContextMut>(@@ -562,7 +558,6 @@ pub mod exports {>::new_unchecked(self.funcs.static_a_static_a)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_method_a<S: wasmtime::AsContextMut>(@@ -581,7 +576,6 @@ pub mod exports {>::new_unchecked(self.funcs.method_a_method_a)};let (ret0,) = callee.call(store.as_context_mut(), (arg0, arg1))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}@@ -673,7 +667,6 @@ pub mod exports {>::new_unchecked(self.funcs.constructor_a_constructor)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}@@ -767,7 +760,6 @@ pub mod exports {>::new_unchecked(self.funcs.constructor_b_constructor)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/resources-export_async.rs b/crates/component-macro/tests/expanded/resources-export_async.rsindex b76fe9a4db..8700849d32 100644--- a/crates/component-macro/tests/expanded/resources-export_async.rs+++ b/crates/component-macro/tests/expanded/resources-export_async.rs@@ -408,7 +408,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_static_a<S: wasmtime::AsContextMut>(@@ -427,7 +426,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_method_a<S: wasmtime::AsContextMut>(@@ -447,7 +445,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}@@ -573,7 +570,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_static_a<S: wasmtime::AsContextMut>(@@ -592,7 +588,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_method_a<S: wasmtime::AsContextMut>(@@ -616,7 +611,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0, arg1)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}@@ -713,7 +707,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}@@ -812,7 +805,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/resources-export_tracing_async.rs b/crates/component-macro/tests/expanded/resources-export_tracing_async.rsindex d206775ffc..fd10dcaa78 100644--- a/crates/component-macro/tests/expanded/resources-export_tracing_async.rs+++ b/crates/component-macro/tests/expanded/resources-export_tracing_async.rs@@ -414,10 +414,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_static_a<S: wasmtime::AsContextMut>(@@ -442,10 +438,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_method_a<S: wasmtime::AsContextMut>(@@ -471,10 +463,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}@@ -606,10 +594,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_static_a<S: wasmtime::AsContextMut>(@@ -635,10 +619,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_method_a<S: wasmtime::AsContextMut>(@@ -669,10 +649,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0, arg1)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}@@ -775,10 +751,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}@@ -883,10 +855,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/resources-import.rs b/crates/component-macro/tests/expanded/resources-import.rsindex d1bee31e25..529386a3ae 100644--- a/crates/component-macro/tests/expanded/resources-import.rs+++ b/crates/component-macro/tests/expanded/resources-import.rs@@ -360,7 +360,6 @@ const _: () = {>::new_unchecked(self.some_world_func2)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn foo_foo_uses_resource_transitively(@@ -1208,7 +1207,6 @@ pub mod exports {>::new_unchecked(self.handle)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/resources-import_async.rs b/crates/component-macro/tests/expanded/resources-import_async.rsindex 4a05233865..c340a80b05 100644--- a/crates/component-macro/tests/expanded/resources-import_async.rs+++ b/crates/component-macro/tests/expanded/resources-import_async.rs@@ -396,7 +396,6 @@ const _: () = {>::new_unchecked(self.some_world_func2)};let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub fn foo_foo_uses_resource_transitively(@@ -1400,7 +1399,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/resources-import_tracing_async.rs b/crates/component-macro/tests/expanded/resources-import_tracing_async.rsindex f8c847b39c..7e2c631f5d 100644--- a/crates/component-macro/tests/expanded/resources-import_tracing_async.rs+++ b/crates/component-macro/tests/expanded/resources-import_tracing_async.rs@@ -459,7 +459,6 @@ const _: () = {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee.post_return_async(store.as_context_mut()).instrument(span).await?;Ok(ret0)}pub fn foo_foo_uses_resource_transitively(@@ -1823,10 +1822,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/share-types.rs b/crates/component-macro/tests/expanded/share-types.rsindex 01de354735..c09a5e9fad 100644--- a/crates/component-macro/tests/expanded/share-types.rs+++ b/crates/component-macro/tests/expanded/share-types.rs@@ -386,7 +386,6 @@ pub mod exports {>::new_unchecked(self.handle_request)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/share-types_async.rs b/crates/component-macro/tests/expanded/share-types_async.rsindex 40df5be0fe..38f3fbfaab 100644--- a/crates/component-macro/tests/expanded/share-types_async.rs+++ b/crates/component-macro/tests/expanded/share-types_async.rs@@ -397,7 +397,6 @@ pub mod exports {>::new_unchecked(self.handle_request)};let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/share-types_tracing_async.rs b/crates/component-macro/tests/expanded/share-types_tracing_async.rsindex 528b1bdfab..8b2308e0f5 100644--- a/crates/component-macro/tests/expanded/share-types_tracing_async.rs+++ b/crates/component-macro/tests/expanded/share-types_tracing_async.rs@@ -421,7 +421,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee.post_return_async(store.as_context_mut()).instrument(span).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/simple-functions.rs b/crates/component-macro/tests/expanded/simple-functions.rsindex b84b8ce9ae..bb3ab3f3ec 100644--- a/crates/component-macro/tests/expanded/simple-functions.rs+++ b/crates/component-macro/tests/expanded/simple-functions.rs@@ -409,7 +409,6 @@ pub mod exports {>::new_unchecked(self.f1)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_f2<S: wasmtime::AsContextMut>(@@ -424,7 +423,6 @@ pub mod exports {>::new_unchecked(self.f2)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_f3<S: wasmtime::AsContextMut>(@@ -440,7 +438,6 @@ pub mod exports {>::new_unchecked(self.f3)};let () = callee.call(store.as_context_mut(), (arg0, arg1))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_f4<S: wasmtime::AsContextMut>(@@ -454,7 +451,6 @@ pub mod exports {>::new_unchecked(self.f4)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_f5<S: wasmtime::AsContextMut>(@@ -468,7 +464,6 @@ pub mod exports {>::new_unchecked(self.f5)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_f6<S: wasmtime::AsContextMut>(@@ -486,7 +481,6 @@ pub mod exports {};let (ret0,) = callee.call(store.as_context_mut(), (arg0, arg1, arg2))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/simple-functions_async.rs b/crates/component-macro/tests/expanded/simple-functions_async.rsindex 8d657a642a..dd74e75b26 100644--- a/crates/component-macro/tests/expanded/simple-functions_async.rs+++ b/crates/component-macro/tests/expanded/simple-functions_async.rs@@ -452,7 +452,6 @@ pub mod exports {>::new_unchecked(self.f1)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_f2<S: wasmtime::AsContextMut>(@@ -472,7 +471,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_f3<S: wasmtime::AsContextMut>(@@ -493,7 +491,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0, arg1)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_f4<S: wasmtime::AsContextMut>(@@ -512,7 +509,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_f5<S: wasmtime::AsContextMut>(@@ -531,7 +527,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_f6<S: wasmtime::AsContextMut>(@@ -553,7 +548,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0, arg1, arg2)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/simple-functions_tracing_async.rs b/crates/component-macro/tests/expanded/simple-functions_tracing_async.rsindex da8d87114b..c52a322f37 100644--- a/crates/component-macro/tests/expanded/simple-functions_tracing_async.rs+++ b/crates/component-macro/tests/expanded/simple-functions_tracing_async.rs@@ -548,10 +548,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_f2<S: wasmtime::AsContextMut>(@@ -577,10 +573,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_f3<S: wasmtime::AsContextMut>(@@ -607,10 +599,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0, arg1)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_f4<S: wasmtime::AsContextMut>(@@ -635,10 +623,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_f5<S: wasmtime::AsContextMut>(@@ -663,10 +647,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_f6<S: wasmtime::AsContextMut>(@@ -694,10 +674,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0, arg1, arg2)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/simple-lists.rs b/crates/component-macro/tests/expanded/simple-lists.rsindex 4baa0f1e35..a6cc8f30eb 100644--- a/crates/component-macro/tests/expanded/simple-lists.rs+++ b/crates/component-macro/tests/expanded/simple-lists.rs@@ -444,7 +444,6 @@ pub mod exports {>::new_unchecked(self.simple_list1)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_simple_list2<S: wasmtime::AsContextMut>(@@ -458,7 +457,6 @@ pub mod exports {>::new_unchecked(self.simple_list2)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_simple_list3<S: wasmtime::AsContextMut>(@@ -484,7 +482,6 @@ pub mod exports {>::new_unchecked(self.simple_list3)};let (ret0,) = callee.call(store.as_context_mut(), (arg0, arg1))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_simple_list4<S: wasmtime::AsContextMut>(@@ -507,7 +504,6 @@ pub mod exports {>::new_unchecked(self.simple_list4)};let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/simple-lists_async.rs b/crates/component-macro/tests/expanded/simple-lists_async.rsindex 45351a3270..d2270ce466 100644--- a/crates/component-macro/tests/expanded/simple-lists_async.rs+++ b/crates/component-macro/tests/expanded/simple-lists_async.rs@@ -473,7 +473,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_simple_list2<S: wasmtime::AsContextMut>(@@ -492,7 +491,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_simple_list3<S: wasmtime::AsContextMut>(@@ -523,7 +521,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0, arg1)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_simple_list4<S: wasmtime::AsContextMut>(@@ -551,7 +548,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/simple-lists_tracing_async.rs b/crates/component-macro/tests/expanded/simple-lists_tracing_async.rsindex a4dd7f2c92..3e3784d15c 100644--- a/crates/component-macro/tests/expanded/simple-lists_tracing_async.rs+++ b/crates/component-macro/tests/expanded/simple-lists_tracing_async.rs@@ -540,10 +540,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_simple_list2<S: wasmtime::AsContextMut>(@@ -568,10 +564,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_simple_list3<S: wasmtime::AsContextMut>(@@ -608,10 +600,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0, arg1)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_simple_list4<S: wasmtime::AsContextMut>(@@ -645,10 +633,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/small-anonymous.rs b/crates/component-macro/tests/expanded/small-anonymous.rsindex b9fc3f1755..3d78db6a40 100644--- a/crates/component-macro/tests/expanded/small-anonymous.rs+++ b/crates/component-macro/tests/expanded/small-anonymous.rs@@ -420,7 +420,6 @@ pub mod exports {>::new_unchecked(self.option_test)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/small-anonymous_async.rs b/crates/component-macro/tests/expanded/small-anonymous_async.rsindex 8eefe0a159..db741f17d4 100644--- a/crates/component-macro/tests/expanded/small-anonymous_async.rs+++ b/crates/component-macro/tests/expanded/small-anonymous_async.rs@@ -437,7 +437,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/small-anonymous_tracing_async.rs b/crates/component-macro/tests/expanded/small-anonymous_tracing_async.rsindex b1af31909f..da50424254 100644--- a/crates/component-macro/tests/expanded/small-anonymous_tracing_async.rs+++ b/crates/component-macro/tests/expanded/small-anonymous_tracing_async.rs@@ -456,10 +456,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/smoke-default.rs b/crates/component-macro/tests/expanded/smoke-default.rsindex 9d963544c9..7ae5656392 100644--- a/crates/component-macro/tests/expanded/smoke-default.rs+++ b/crates/component-macro/tests/expanded/smoke-default.rs@@ -188,7 +188,6 @@ const _: () = {wasmtime::component::TypedFunc::<(), ()>::new_unchecked(self.y)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/smoke-default_async.rs b/crates/component-macro/tests/expanded/smoke-default_async.rsindex aac53efe63..162c1f3a39 100644--- a/crates/component-macro/tests/expanded/smoke-default_async.rs+++ b/crates/component-macro/tests/expanded/smoke-default_async.rs@@ -191,7 +191,6 @@ const _: () = {wasmtime::component::TypedFunc::<(), ()>::new_unchecked(self.y)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/smoke-default_tracing_async.rs b/crates/component-macro/tests/expanded/smoke-default_tracing_async.rsindex be3c62e52f..b7c0a8be5f 100644--- a/crates/component-macro/tests/expanded/smoke-default_tracing_async.rs+++ b/crates/component-macro/tests/expanded/smoke-default_tracing_async.rs@@ -199,7 +199,6 @@ const _: () = {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee.post_return_async(store.as_context_mut()).instrument(span).await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/smoke-export.rs b/crates/component-macro/tests/expanded/smoke-export.rsindex 258a037411..677cc4a8e2 100644--- a/crates/component-macro/tests/expanded/smoke-export.rs+++ b/crates/component-macro/tests/expanded/smoke-export.rs@@ -238,7 +238,6 @@ pub mod exports {wasmtime::component::TypedFunc::<(), ()>::new_unchecked(self.y)};let () = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/smoke-export_async.rs b/crates/component-macro/tests/expanded/smoke-export_async.rsindex e0ec6d94bf..c58e52ffab 100644--- a/crates/component-macro/tests/expanded/smoke-export_async.rs+++ b/crates/component-macro/tests/expanded/smoke-export_async.rs@@ -241,7 +241,6 @@ pub mod exports {wasmtime::component::TypedFunc::<(), ()>::new_unchecked(self.y)};let () = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/smoke-export_tracing_async.rs b/crates/component-macro/tests/expanded/smoke-export_tracing_async.rsindex 2cd5f96758..7cfb00cff9 100644--- a/crates/component-macro/tests/expanded/smoke-export_tracing_async.rs+++ b/crates/component-macro/tests/expanded/smoke-export_tracing_async.rs@@ -249,7 +249,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee.post_return_async(store.as_context_mut()).instrument(span).await?;Ok(())}}diff --git a/crates/component-macro/tests/expanded/strings.rs b/crates/component-macro/tests/expanded/strings.rsindex c3abeab1c2..d3f3395eaa 100644--- a/crates/component-macro/tests/expanded/strings.rs+++ b/crates/component-macro/tests/expanded/strings.rs@@ -366,7 +366,6 @@ pub mod exports {>::new_unchecked(self.a)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_b<S: wasmtime::AsContextMut>(@@ -380,7 +379,6 @@ pub mod exports {>::new_unchecked(self.b)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_c<S: wasmtime::AsContextMut>(@@ -396,7 +394,6 @@ pub mod exports {>::new_unchecked(self.c)};let (ret0,) = callee.call(store.as_context_mut(), (arg0, arg1))?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/strings_async.rs b/crates/component-macro/tests/expanded/strings_async.rsindex 9c9b93d739..3fa28e3324 100644--- a/crates/component-macro/tests/expanded/strings_async.rs+++ b/crates/component-macro/tests/expanded/strings_async.rs@@ -395,7 +395,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_b<S: wasmtime::AsContextMut>(@@ -414,7 +413,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_c<S: wasmtime::AsContextMut>(@@ -435,7 +433,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), (arg0, arg1)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/strings_tracing_async.rs b/crates/component-macro/tests/expanded/strings_tracing_async.rsindex 834bbfe78d..115d9abf32 100644--- a/crates/component-macro/tests/expanded/strings_tracing_async.rs+++ b/crates/component-macro/tests/expanded/strings_tracing_async.rs@@ -446,10 +446,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_b<S: wasmtime::AsContextMut>(@@ -474,10 +470,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_c<S: wasmtime::AsContextMut>(@@ -504,10 +496,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0, arg1)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/variants.rs b/crates/component-macro/tests/expanded/variants.rsindex dc2572b7de..307e68f46f 100644--- a/crates/component-macro/tests/expanded/variants.rs+++ b/crates/component-macro/tests/expanded/variants.rs@@ -1549,7 +1549,6 @@ pub mod exports {>::new_unchecked(self.e1_arg)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_e1_result<S: wasmtime::AsContextMut>(@@ -1563,7 +1562,6 @@ pub mod exports {>::new_unchecked(self.e1_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_v1_arg<S: wasmtime::AsContextMut>(@@ -1578,7 +1576,6 @@ pub mod exports {>::new_unchecked(self.v1_arg)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_v1_result<S: wasmtime::AsContextMut>(@@ -1592,7 +1589,6 @@ pub mod exports {>::new_unchecked(self.v1_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_bool_arg<S: wasmtime::AsContextMut>(@@ -1607,7 +1603,6 @@ pub mod exports {>::new_unchecked(self.bool_arg)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_bool_result<S: wasmtime::AsContextMut>(@@ -1621,7 +1616,6 @@ pub mod exports {>::new_unchecked(self.bool_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_option_arg<S: wasmtime::AsContextMut>(@@ -1652,7 +1646,6 @@ pub mod exports {store.as_context_mut(),(arg0, arg1, arg2, arg3, arg4, arg5),)?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_option_result<S: wasmtime::AsContextMut>(@@ -1684,7 +1677,6 @@ pub mod exports {>::new_unchecked(self.option_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_casts<S: wasmtime::AsContextMut>(@@ -1710,7 +1702,6 @@ pub mod exports {store.as_context_mut(),(arg0, arg1, arg2, arg3, arg4, arg5),)?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_result_arg<S: wasmtime::AsContextMut>(@@ -1741,7 +1732,6 @@ pub mod exports {store.as_context_mut(),(arg0, arg1, arg2, arg3, arg4, arg5),)?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_result_result<S: wasmtime::AsContextMut>(@@ -1779,7 +1769,6 @@ pub mod exports {>::new_unchecked(self.result_result)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_return_result_sugar<S: wasmtime::AsContextMut>(@@ -1793,7 +1782,6 @@ pub mod exports {>::new_unchecked(self.return_result_sugar)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_return_result_sugar2<S: wasmtime::AsContextMut>(@@ -1807,7 +1795,6 @@ pub mod exports {>::new_unchecked(self.return_result_sugar2)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_return_result_sugar3<S: wasmtime::AsContextMut>(@@ -1821,7 +1808,6 @@ pub mod exports {>::new_unchecked(self.return_result_sugar3)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_return_result_sugar4<S: wasmtime::AsContextMut>(@@ -1835,7 +1821,6 @@ pub mod exports {>::new_unchecked(self.return_result_sugar4)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_return_option_sugar<S: wasmtime::AsContextMut>(@@ -1849,7 +1834,6 @@ pub mod exports {>::new_unchecked(self.return_option_sugar)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_return_option_sugar2<S: wasmtime::AsContextMut>(@@ -1863,7 +1847,6 @@ pub mod exports {>::new_unchecked(self.return_option_sugar2)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_result_simple<S: wasmtime::AsContextMut>(@@ -1877,7 +1860,6 @@ pub mod exports {>::new_unchecked(self.result_simple)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}pub fn call_is_clone_arg<S: wasmtime::AsContextMut>(@@ -1892,7 +1874,6 @@ pub mod exports {>::new_unchecked(self.is_clone_arg)};let () = callee.call(store.as_context_mut(), (arg0,))?;- callee.post_return(store.as_context_mut())?;Ok(())}pub fn call_is_clone_return<S: wasmtime::AsContextMut>(@@ -1906,7 +1887,6 @@ pub mod exports {>::new_unchecked(self.is_clone_return)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/variants_async.rs b/crates/component-macro/tests/expanded/variants_async.rsindex 63fb6f5566..942c27cee2 100644--- a/crates/component-macro/tests/expanded/variants_async.rs+++ b/crates/component-macro/tests/expanded/variants_async.rs@@ -1685,7 +1685,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_e1_result<S: wasmtime::AsContextMut>(@@ -1704,7 +1703,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_v1_arg<S: wasmtime::AsContextMut>(@@ -1724,7 +1722,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_v1_result<S: wasmtime::AsContextMut>(@@ -1743,7 +1740,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_bool_arg<S: wasmtime::AsContextMut>(@@ -1763,7 +1759,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_bool_result<S: wasmtime::AsContextMut>(@@ -1782,7 +1777,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_option_arg<S: wasmtime::AsContextMut>(@@ -1817,7 +1811,6 @@ pub mod exports {(arg0, arg1, arg2, arg3, arg4, arg5),).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_option_result<S: wasmtime::AsContextMut>(@@ -1854,7 +1847,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_casts<S: wasmtime::AsContextMut>(@@ -1884,7 +1876,6 @@ pub mod exports {(arg0, arg1, arg2, arg3, arg4, arg5),).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_result_arg<S: wasmtime::AsContextMut>(@@ -1919,7 +1910,6 @@ pub mod exports {(arg0, arg1, arg2, arg3, arg4, arg5),).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_result_result<S: wasmtime::AsContextMut>(@@ -1962,7 +1952,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_return_result_sugar<S: wasmtime::AsContextMut>(@@ -1981,7 +1970,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_return_result_sugar2<S: wasmtime::AsContextMut>(@@ -2000,7 +1988,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_return_result_sugar3<S: wasmtime::AsContextMut>(@@ -2019,7 +2006,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_return_result_sugar4<S: wasmtime::AsContextMut>(@@ -2038,7 +2024,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_return_option_sugar<S: wasmtime::AsContextMut>(@@ -2057,7 +2042,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_return_option_sugar2<S: wasmtime::AsContextMut>(@@ -2076,7 +2060,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_result_simple<S: wasmtime::AsContextMut>(@@ -2095,7 +2078,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}pub async fn call_is_clone_arg<S: wasmtime::AsContextMut>(@@ -2115,7 +2097,6 @@ pub mod exports {let () = callee.call_async(store.as_context_mut(), (arg0,)).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(())}pub async fn call_is_clone_return<S: wasmtime::AsContextMut>(@@ -2134,7 +2115,6 @@ pub mod exports {let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/variants_tracing_async.rs b/crates/component-macro/tests/expanded/variants_tracing_async.rsindex b3bd51ad46..b51de12b42 100644--- a/crates/component-macro/tests/expanded/variants_tracing_async.rs+++ b/crates/component-macro/tests/expanded/variants_tracing_async.rs@@ -1989,10 +1989,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_e1_result<S: wasmtime::AsContextMut>(@@ -2017,10 +2013,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_v1_arg<S: wasmtime::AsContextMut>(@@ -2046,10 +2038,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_v1_result<S: wasmtime::AsContextMut>(@@ -2074,10 +2062,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_bool_arg<S: wasmtime::AsContextMut>(@@ -2103,10 +2087,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_bool_result<S: wasmtime::AsContextMut>(@@ -2131,10 +2111,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_option_arg<S: wasmtime::AsContextMut>(@@ -2175,10 +2151,6 @@ pub mod exports {).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_option_result<S: wasmtime::AsContextMut>(@@ -2221,10 +2193,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_casts<S: wasmtime::AsContextMut>(@@ -2260,10 +2228,6 @@ pub mod exports {).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_result_arg<S: wasmtime::AsContextMut>(@@ -2304,10 +2268,6 @@ pub mod exports {).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_result_result<S: wasmtime::AsContextMut>(@@ -2356,10 +2316,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_return_result_sugar<S: wasmtime::AsContextMut>(@@ -2384,10 +2340,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_return_result_sugar2<S: wasmtime::AsContextMut>(@@ -2412,10 +2364,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_return_result_sugar3<S: wasmtime::AsContextMut>(@@ -2440,10 +2388,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_return_result_sugar4<S: wasmtime::AsContextMut>(@@ -2468,10 +2412,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_return_option_sugar<S: wasmtime::AsContextMut>(@@ -2496,10 +2436,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_return_option_sugar2<S: wasmtime::AsContextMut>(@@ -2524,10 +2460,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_result_simple<S: wasmtime::AsContextMut>(@@ -2552,10 +2484,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}pub async fn call_is_clone_arg<S: wasmtime::AsContextMut>(@@ -2581,10 +2509,6 @@ pub mod exports {.call_async(store.as_context_mut(), (arg0,)).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(())}pub async fn call_is_clone_return<S: wasmtime::AsContextMut>(@@ -2609,10 +2533,6 @@ pub mod exports {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee- .post_return_async(store.as_context_mut())- .instrument(span)- .await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/worlds-with-types.rs b/crates/component-macro/tests/expanded/worlds-with-types.rsindex 851cbd9a20..4e212025a4 100644--- a/crates/component-macro/tests/expanded/worlds-with-types.rs+++ b/crates/component-macro/tests/expanded/worlds-with-types.rs@@ -227,7 +227,6 @@ const _: () = {wasmtime::component::TypedFunc::<(), ((T, U, R),)>::new_unchecked(self.f)};let (ret0,) = callee.call(store.as_context_mut(), ())?;- callee.post_return(store.as_context_mut())?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/worlds-with-types_async.rs b/crates/component-macro/tests/expanded/worlds-with-types_async.rsindex e15c9de984..0215a65619 100644--- a/crates/component-macro/tests/expanded/worlds-with-types_async.rs+++ b/crates/component-macro/tests/expanded/worlds-with-types_async.rs@@ -230,7 +230,6 @@ const _: () = {wasmtime::component::TypedFunc::<(), ((T, U, R),)>::new_unchecked(self.f)};let (ret0,) = callee.call_async(store.as_context_mut(), ()).await?;- callee.post_return_async(store.as_context_mut()).await?;Ok(ret0)}}diff --git a/crates/component-macro/tests/expanded/worlds-with-types_tracing_async.rs b/crates/component-macro/tests/expanded/worlds-with-types_tracing_async.rsindex 6222f35d2e..ae5286ec1b 100644--- a/crates/component-macro/tests/expanded/worlds-with-types_tracing_async.rs+++ b/crates/component-macro/tests/expanded/worlds-with-types_tracing_async.rs@@ -238,7 +238,6 @@ const _: () = {.call_async(store.as_context_mut(), ()).instrument(span.clone()).await?;- callee.post_return_async(store.as_context_mut()).instrument(span).await?;Ok(ret0)}}diff --git a/crates/environ/src/component/vmcomponent_offsets.rs b/crates/environ/src/component/vmcomponent_offsets.rsindex 2fc76f7e03..12149161c0 100644--- a/crates/environ/src/component/vmcomponent_offsets.rs+++ b/crates/environ/src/component/vmcomponent_offsets.rs@@ -29,10 +29,6 @@ pub const VMCOMPONENT_MAGIC: u32 = u32::from_le_bytes(*b"comp");/// canonical ABI flag `may_leave`pub const FLAG_MAY_LEAVE: i32 = 1 << 0;-/// Flag for the `VMComponentContext::flags` field which is set whenever a-/// function is called to indicate that `post_return` must be called next.-pub const FLAG_NEEDS_POST_RETURN: i32 = 1 << 2;-/// Runtime offsets within a `VMComponentContext` for a specific component.#[derive(Debug, Clone, Copy)]pub struct VMComponentOffsets<P> {diff --git a/crates/fuzzing/src/oracles/component_api.rs b/crates/fuzzing/src/oracles/component_api.rsindex 47f0faae57..131f92d6e7 100644--- a/crates/fuzzing/src/oracles/component_api.rs+++ b/crates/fuzzing/src/oracles/component_api.rs@@ -278,9 +278,7 @@ where.await.unwrap()} else {- let result = func.call_async(&mut store, params).await.unwrap();- func.post_return_async(&mut store).await.unwrap();- result+ func.call_async(&mut store, params).await.unwrap()};log::trace!("got result {actual:?}");assert_eq!(actual, result);@@ -382,7 +380,6 @@ pub fn dynamic_component_api_target(input: &mut arbitrary::Unstructured) -> arbifunc.call_async(&mut store, ¶ms, &mut actual).await.unwrap();- func.post_return_async(&mut store).await.unwrap();}log::trace!("received results {actual:?}");assert_eq!(actual, results);diff --git a/crates/misc/component-async-tests/tests/scenario/round_trip.rs b/crates/misc/component-async-tests/tests/scenario/round_trip.rsindex a1314e52bd..21a52345b0 100644--- a/crates/misc/component-async-tests/tests/scenario/round_trip.rs+++ b/crates/misc/component-async-tests/tests/scenario/round_trip.rs@@ -569,7 +569,6 @@ pub async fn test_round_trip(unreachable!()};assert_eq!(*expected, actual);- foo_function.post_return_async(&mut store).await?;}store.assert_concurrent_state_empty();diff --git a/crates/misc/component-async-tests/tests/scenario/round_trip_many.rs b/crates/misc/component-async-tests/tests/scenario/round_trip_many.rsindex 980b46a923..1cd0999374 100644--- a/crates/misc/component-async-tests/tests/scenario/round_trip_many.rs+++ b/crates/misc/component-async-tests/tests/scenario/round_trip_many.rs@@ -425,7 +425,6 @@ async fn test_round_trip_many(unreachable!()};assert_eq!(&make(expected), actual);- foo_function.post_return_async(&mut store).await?;}store.assert_concurrent_state_empty();diff --git a/crates/test-util/src/component.rs b/crates/test-util/src/component.rsindex c711ce908e..fb31b594a5 100644--- a/crates/test-util/src/component.rs+++ b/crates/test-util/src/component.rs@@ -3,52 +3,10 @@ use std::mem::MaybeUninit;use wasmtime::component::__internal::{CanonicalAbiInfo, InstanceType, InterfaceType, LiftContext, LowerContext,};-use wasmtime::component::{ComponentNamedList, ComponentType, Func, Lift, Lower, TypedFunc, Val};-use wasmtime::{AsContextMut, Config, Engine};+use wasmtime::component::{ComponentType, Lift, Lower};+use wasmtime::{Config, Engine};use wasmtime_environ::prelude::*;-pub trait TypedFuncExt<P, R> {- fn call_and_post_return(&self, store: impl AsContextMut<Data: Send>, params: P) -> Result<R>;-}--impl<P, R> TypedFuncExt<P, R> for TypedFunc<P, R>-where- P: ComponentNamedList + Lower,- R: ComponentNamedList + Lift + Send + Sync + 'static,-{- fn call_and_post_return(- &self,- mut store: impl AsContextMut<Data: Send>,- params: P,- ) -> Result<R> {- let result = self.call(&mut store, params)?;- self.post_return(&mut store)?;- Ok(result)- }-}--pub trait FuncExt {- fn call_and_post_return(- &self,- store: impl AsContextMut<Data: Send>,- params: &[Val],- results: &mut [Val],- ) -> Result<()>;-}--impl FuncExt for Func {- fn call_and_post_return(- &self,- mut store: impl AsContextMut<Data: Send>,- params: &[Val],- results: &mut [Val],- ) -> Result<()> {- self.call(&mut store, params, results)?;- self.post_return(&mut store)?;- Ok(())- }-}-pub fn config() -> Config {drop(env_logger::try_init());diff --git a/crates/wasmtime/src/runtime/component/concurrent.rs b/crates/wasmtime/src/runtime/component/concurrent.rsindex 113bdda063..6c4323e4bc 100644--- a/crates/wasmtime/src/runtime/component/concurrent.rs+++ b/crates/wasmtime/src/runtime/component/concurrent.rs@@ -50,7 +50,7 @@//! store. This is equivalent to `StoreContextMut::spawn` but more convenient to use//! in host functions.-use crate::component::func::{self, Func};+use crate::component::func::{self, Func, call_post_return};use crate::component::{HasData, HasSelf, Instance, Resource, ResourceTable, ResourceTableError, RuntimeInstance,};@@ -81,7 +81,6 @@ use std::mem::{self, ManuallyDrop, MaybeUninit};use std::ops::DerefMut;use std::pin::{Pin, pin};use std::ptr::{self, NonNull};-use std::slice;use std::sync::Arc;use std::task::{Context, Poll, Waker};use std::vec::Vec;@@ -1444,7 +1443,6 @@ impl StoreOpaque {tx: None,exit_tx: Arc::new(oneshot::channel().0),host_future_present: false,- call_post_return_automatically: false,caller: state.guest_thread,}},@@ -1520,14 +1518,14 @@ impl StoreOpaque {/// - `self` has not been poisoned due to a trap.pub(crate) fn may_enter(&mut self, instance: RuntimeInstance) -> bool {if !self.concurrency_support() {- return self.may_enter_at_all(instance);+ return !self.trapped();}let state = self.concurrent_state_mut();if let Some(caller) = state.guest_thread {instance != state.get_mut(caller.task).unwrap().instance&& self.may_enter_from_caller(caller.task, instance)} else {- self.may_enter_at_all(instance)+ !self.trapped()}}@@ -1545,7 +1543,7 @@ impl StoreOpaque {mut guest_task: TableId<GuestTask>,instance: RuntimeInstance,) -> bool {- self.may_enter_at_all(instance) && {+ !self.trapped() && {let state = self.concurrent_state_mut();let guest_instance = instance.instance;loop {@@ -2225,7 +2223,7 @@ impl Instance {log::trace!("sync/async-stackful call: replaced {old_thread:?} with {guest_thread:?} as current thread",);- let mut flags = self.id().get(store).instance_flags(callee_instance.index);+ let flags = self.id().get(store).instance_flags(callee_instance.index);store.maybe_push_call_context(guest_thread.task)?;@@ -2244,12 +2242,9 @@ impl Instance {// over must be valid.let storage = call(store)?;- // This is a callback-less call, so the implicit thread has now completed- self.cleanup_thread(store, guest_thread, callee_instance.index)?;-if async_ {let task = store.concurrent_state_mut().get_mut(guest_thread.task)?;- if task.threads.is_empty() && !task.returned_or_cancelled() {+ if task.threads.len() == 1 && !task.returned_or_cancelled() {bail!(Trap::NoAsyncResult);}} else {@@ -2287,47 +2282,21 @@ impl Instance {_ => unreachable!(),};- if store- .concurrent_state_mut()- .get_mut(guest_thread.task)?- .call_post_return_automatically()- {- unsafe {- flags.set_may_leave(false);- flags.set_needs_post_return(false);- }-- if let Some(func) = post_return {- let mut store = token.as_context_mut(store);-- // SAFETY: `func` is a valid `*mut VMFuncRef` from- // either `wasmtime-cranelift`-generated fused adapter- // code or `component::Options`. Per `wasmparser`- // post-return signature validation, we know it takes a- // single parameter.- unsafe {- crate::Func::call_unchecked_raw(- &mut store,- func.as_non_null(),- slice::from_ref(&post_return_arg).into(),- )?;- }- }-- unsafe {- flags.set_may_leave(true);- }+ unsafe {+ call_post_return(+ token.as_context_mut(store),+ post_return.map(|v| v.as_non_null()),+ post_return_arg,+ flags,+ )?;}- self.task_complete(- store,- guest_thread.task,- result,- Status::Returned,- post_return_arg,- )?;+ self.task_complete(store, guest_thread.task, result, Status::Returned)?;}+ // This is a callback-less call, so the implicit thread has now completed+ self.cleanup_thread(store, guest_thread, callee_instance.index)?;+store.set_thread(old_thread);store.maybe_pop_call_context(guest_thread.task)?;@@ -2975,13 +2944,7 @@ impl Instance {log::trace!("task.return for {guest_thread:?}");let result = (lift.lift)(store, storage)?;- self.task_complete(- store,- guest_thread.task,- result,- Status::Returned,- ValRaw::i32(0),- )+ self.task_complete(store, guest_thread.task, result, Status::Returned)}/// Implements the `task.cancel` intrinsic.@@ -3011,7 +2974,6 @@ impl Instance {guest_thread.task,Box::new(DummyResult),Status::ReturnCancelled,- ValRaw::i32(0),)}@@ -3026,35 +2988,14 @@ impl Instance {guest_task: TableId<GuestTask>,result: Box<dyn Any + Send + Sync>,status: Status,- post_return_arg: ValRaw,) -> Result<()> {- if store- .concurrent_state_mut()- .get_mut(guest_task)?- .call_post_return_automatically()- {- let (calls, host_table, _, instance) =- store.component_resource_state_with_instance(self);- ResourceTables {- calls,- host_table: Some(host_table),- guest: Some(instance.instance_states()),- }- .exit_call()?;- } else {- // As of this writing, the only scenario where `call_post_return_automatically`- // would be false for a `GuestTask` is for host-to-guest calls using- // `[Typed]Func::call_async`, in which case the `function_index`- // should be a non-`None` value.- let function_index = store- .concurrent_state_mut()- .get_mut(guest_task)?- .function_index- .unwrap();- self.id()- .get_mut(store)- .post_return_arg_set(function_index, post_return_arg);+ let (calls, host_table, _, instance) = store.component_resource_state_with_instance(self);+ ResourceTables {+ calls,+ host_table: Some(host_table),+ guest: Some(instance.instance_states()),}+ .exit_call()?;let state = store.concurrent_state_mut();let task = state.get_mut(guest_task)?;@@ -4321,8 +4262,6 @@ enum Caller {/// If true, there's a host future that must be dropped before the task/// can be deleted.host_future_present: bool,- /// If true, call `post-return` function (if any) automatically.- call_post_return_automatically: bool,/// If `Some`, represents the `QualifiedThreadId` caller of the host/// function which called back into a guest. Note that this thread/// could belong to an entirely unrelated top-level component instance@@ -4656,7 +4595,6 @@ impl GuestTask {// exited:exit_tx: exit_tx.clone(),host_future_present: false,- call_post_return_automatically: true,caller: *caller,};}@@ -4672,17 +4610,6 @@ impl GuestTask {Ok(())}-- fn call_post_return_automatically(&self) -> bool {- matches!(- self.caller,- Caller::Guest { .. }- | Caller::Host {- call_post_return_automatically: true,- ..- }- )- }}impl TableDebug for GuestTask {@@ -5300,7 +5227,6 @@ pub(crate) fn prepare_call<T, R>(handle: Func,param_count: usize,host_future_present: bool,- call_post_return_automatically: bool,lower_params: impl FnOnce(Func, StoreContextMut<T>, &mut [MaybeUninit<ValRaw>]) -> Result<()>+ Send+ Sync@@ -5348,7 +5274,6 @@ pub(crate) fn prepare_call<T, R>(tx: Some(tx),exit_tx: Arc::new(exit_tx),host_future_present,- call_post_return_automatically,caller,},callback.map(|callback| {diff --git a/crates/wasmtime/src/runtime/component/concurrent_disabled.rs b/crates/wasmtime/src/runtime/component/concurrent_disabled.rsindex 5bfd79f762..629c2c1fc9 100644--- a/crates/wasmtime/src/runtime/component/concurrent_disabled.rs+++ b/crates/wasmtime/src/runtime/component/concurrent_disabled.rs@@ -172,7 +172,7 @@ impl StoreOpaque {Ok(())}- pub(crate) fn may_enter(&mut self, instance: RuntimeInstance) -> bool {- self.may_enter_at_all(instance)+ pub(crate) fn may_enter(&mut self, _instance: RuntimeInstance) -> bool {+ !self.trapped()}}diff --git a/crates/wasmtime/src/runtime/component/func.rs b/crates/wasmtime/src/runtime/component/func.rsindex 0a8cbd9f49..481e0de644 100644--- a/crates/wasmtime/src/runtime/component/func.rs+++ b/crates/wasmtime/src/runtime/component/func.rs@@ -204,10 +204,7 @@ impl Func {/// size of `results` exactly matches the number of results that this/// function produces.///- /// Note that after a function is invoked the embedder needs to invoke- /// [`Func::post_return`] to execute any final cleanup required by the- /// guest. This function call is required to either call the function again- /// or to call another function.+ /// This will also call the corresponding `post-return` function, if any.////// For more detailed information see the documentation of/// [`TypedFunc::call`].@@ -237,14 +234,12 @@ impl Func {) -> Result<()> {let mut store = store.as_context_mut();store.0.validate_sync_call()?;- self.call_impl(&mut store.as_context_mut(), params, results)+ self.call_impl(store.as_context_mut(), params, results)?;+ Ok(())}/// Exactly like [`Self::call`] except for use on async stores.///- /// Note that after this [`Func::post_return_async`] will be used instead of- /// the synchronous version at [`Func::post_return`].- ////// # Panics////// Panics if `store` does not own this function.@@ -261,7 +256,7 @@ impl Func {if store.0.concurrency_support() {return store.run_concurrent_trap_on_idle(async |store| {- self.call_concurrent_dynamic(store, params, results, false)+ self.call_concurrent_dynamic(store, params, results).await.map(drop)})@@ -309,8 +304,7 @@ impl Func {/// exclusive access to the store until the completion of the call), calls/// made using this method may run concurrently with other calls to the same/// instance. In addition, the runtime will call the `post-return` function- /// (if any) automatically when the guest task completes -- no need to- /// explicitly call `Func::post_return` afterward.+ /// (if any) automatically when the guest task completes.////// This returns a [`TaskExit`] representing the completion of the guest/// task and any transitive subtasks it might create.@@ -403,7 +397,7 @@ impl Func {params: &[Val],results: &mut [Val],) -> Result<TaskExit> {- self.call_concurrent_dynamic(accessor, params, results, true)+ self.call_concurrent_dynamic(accessor, params, results).await}@@ -414,15 +408,10 @@ impl Func {accessor: impl AsAccessor<Data: Send>,params: &[Val],results: &mut [Val],- call_post_return_automatically: bool,) -> Result<TaskExit> {let result = accessor.as_accessor().with(|mut store| {self.check_params_results(store.as_context_mut(), params, results)?;- let prepared = self.prepare_call_dynamic(- store.as_context_mut(),- params.to_vec(),- call_post_return_automatically,- )?;+ let prepared = self.prepare_call_dynamic(store.as_context_mut(), params.to_vec())?;concurrent::queue_call(store.as_context_mut(), prepared)})?;@@ -441,7 +430,6 @@ impl Func {self,mut store: StoreContextMut<'a, T>,params: Vec<Val>,- call_post_return_automatically: bool,) -> Result<PreparedCall<Vec<Val>>> {let store = store.as_context_mut();@@ -450,9 +438,8 @@ impl Func {self,MAX_FLAT_PARAMS,false,- call_post_return_automatically,move |func, store, params_out| {- func.with_lower_context(store, call_post_return_automatically, |cx, ty| {+ func.with_lower_context(store, |cx, ty| {Self::lower_args(cx, ¶ms, ty, params_out)})},@@ -503,9 +490,9 @@ impl Func {// safe in Rust, however, due to `ValRaw` being a `union`. The// contents should dynamically not be read due to the type of the// function used here matching the actual lift.- unsafe {+ let (_, post_return_arg) = unsafe {self.call_raw(- store,+ store.as_context_mut(),|cx, ty, dst: &mut MaybeUninit<[MaybeUninit<ValRaw>; MAX_FLAT_PARAMS]>| {// SAFETY: it's safe to assume that// `MaybeUninit<array-of-maybe-uninit>` is initialized because@@ -522,8 +509,10 @@ impl Func {}Ok(())},- )- }+ )?+ };++ self.post_return_impl(store, post_return_arg)}pub(crate) fn lifted_core_func(&self, store: &mut StoreOpaque) -> NonNull<VMFuncRef> {@@ -598,7 +587,7 @@ impl Func {&mut MaybeUninit<LowerParams>,) -> Result<()>,lift: impl FnOnce(&mut LiftContext<'_>, InterfaceType, &LowerReturn) -> Result<Return>,- ) -> Result<Return>+ ) -> Result<(Return, ValRaw)>whereLowerParams: Copy,LowerReturn: Copy,@@ -642,7 +631,7 @@ impl Func {assert!(mem::align_of_val(map_maybe_uninit!(space.params)) == val_align);assert!(mem::align_of_val(map_maybe_uninit!(space.ret)) == val_align);- self.with_lower_context(store.as_context_mut(), false, |cx, ty| {+ self.with_lower_context(store.as_context_mut(), |cx, ty| {cx.enter_call();lower(cx, ty, map_maybe_uninit!(space.params))})?;@@ -682,70 +671,36 @@ impl Func {// is currently required to be 0 or 1 values according to the// canonical ABI, is saved within the `Store`'s `FuncData`. This'll// later get used in post-return.- // flags.set_needs_post_return(true);let val = self.with_lift_context(store.0, |cx, ty| lift(cx, ty, ret))?;// SAFETY: it's a contract of this function that `LowerReturn` is an// appropriate representation of the result of this function.let ret_slice = unsafe { storage_as_slice(ret) };- self.instance.id().get_mut(store.0).post_return_arg_set(- self.index,+ Ok((+ val,match ret_slice.len() {0 => ValRaw::i32(0),1 => ret_slice[0],_ => unreachable!(),},- );-- return Ok(val);+ ))}- /// Invokes the `post-return` canonical ABI option, if specified, after a- /// [`Func::call`] has finished.- ///- /// This function is a required method call after a [`Func::call`] completes- /// successfully. After the embedder has finished processing the return- /// value then this function must be invoked.- ///- /// # Errors- ///- /// This function will return an error in the case of a WebAssembly trap- /// happening during the execution of the `post-return` function, if- /// specified.- ///- /// # Panics- ///- /// This function will panic if it's not called under the correct- /// conditions. This can only be called after a previous invocation of- /// [`Func::call`] completes successfully, and this function can only- /// be called for the same [`Func`] that was `call`'d.- ///- /// If this function is called when [`Func::call`] was not previously- /// called, then it will panic. If a different [`Func`] for the same- /// component instance was invoked then this function will also panic- /// because the `post-return` needs to happen for the other function.- #[inline]- pub fn post_return(&self, mut store: impl AsContextMut) -> Result<()> {- let store = store.as_context_mut();- store.0.validate_sync_call()?;- self.post_return_impl(store, false)+ #[doc(hidden)]+ #[deprecated(note = "no longer needs to be called; this function has no effect")]+ pub fn post_return(&self, _store: impl AsContextMut) -> Result<()> {+ Ok(())}- /// Exactly like [`Self::post_return`] except for invoke WebAssembly- /// [asynchronously](crate#async).+ #[doc(hidden)]+ #[deprecated(note = "no longer needs to be called; this function has no effect")]#[cfg(feature = "async")]- pub async fn post_return_async(&self, mut store: impl AsContextMut<Data: Send>) -> Result<()> {- let mut store = store.as_context_mut();- // Future optimization opportunity: conditionally use a fiber here since- // some func's post_return will not need the async context (i.e. end up- // calling async host functionality)- store- .on_fiber(|store| self.post_return_impl(store, true))- .await?+ pub async fn post_return_async(&self, _store: impl AsContextMut<Data: Send>) -> Result<()> {+ Ok(())}- fn post_return_impl(&self, mut store: impl AsContextMut, async_: bool) -> Result<()> {+ pub(crate) fn post_return_impl(&self, mut store: impl AsContextMut, arg: ValRaw) -> Result<()> {let mut store = store.as_context_mut();let index = self.index;@@ -753,58 +708,10 @@ impl Func {let component = vminstance.component();let (_ty, _def, options) = component.export_lifted_function(index);let post_return = self.post_return_core_func(store.0);- let mut flags =- vminstance.instance_flags(component.env_component().options[options].instance);- let mut instance = self.instance.id().get_mut(store.0);- let post_return_arg = instance.as_mut().post_return_arg_take(index);+ let flags = vminstance.instance_flags(component.env_component().options[options].instance);unsafe {- // First assert that the instance is in a "needs post return" state.- // This will ensure that the previous action on the instance was a- // function call above. This flag is only set after a component- // function returns so this also can't be called (as expected)- // during a host import for example.- //- // Note, though, that this assert is not sufficient because it just- // means some function on this instance needs its post-return- // called. We need a precise post-return for a particular function- // which is the second assert here (the `.expect`). That will assert- // that this function itself needs to have its post-return called.- //- // The theory at least is that these two asserts ensure component- // model semantics are upheld where the host properly calls- // `post_return` on the right function despite the call being a- // separate step in the API.- assert!(- flags.needs_post_return(),- "post_return can only be called after a function has previously been called",- );- let post_return_arg = post_return_arg.expect("calling post_return on wrong function");-- // Unset the "needs post return" flag now that post-return is being- // processed. This will cause future invocations of this method to- // panic, even if the function call below traps.- flags.set_needs_post_return(false);-- // Post return functions are forbidden from calling imports or- // intrinsics.- flags.set_may_leave(false);-- // If the function actually had a `post-return` configured in its- // canonical options that's executed here.- if let Some(func) = post_return {- crate::Func::call_unchecked_raw(- &mut store,- func,- NonNull::new(core::ptr::slice_from_raw_parts(&post_return_arg, 1).cast_mut())- .unwrap(),- )?;- }-- // And finally if everything completed successfully then the "may- // leave" flags is set to `true` again here which enables further- // use of the component.- flags.set_may_leave(true);+ call_post_return(&mut store, post_return, arg, flags)?;let (calls, host_table, _, instance) = store.0@@ -816,7 +723,7 @@ impl Func {}.exit_call()?;- if !async_ && store.0.concurrency_support() {+ if store.0.concurrency_support() {store.0.exit_sync_call(false)?;}}@@ -932,11 +839,9 @@ impl Func {fn with_lower_context<T>(self,mut store: StoreContextMut<T>,- call_post_return_automatically: bool,lower: impl FnOnce(&mut LowerContext<T>, InterfaceType) -> Result<()>,) -> Result<()> {- let (options_idx, mut flags, ty, options) = self.abi_info(store.0);- let async_ = options.async_;+ let (options_idx, mut flags, ty, _) = self.abi_info(store.0);// Perform the actual lowering, where while this is running the// component is forbidden from calling imports.@@ -948,17 +853,7 @@ impl Func {let param_ty = InterfaceType::Tuple(cx.types[ty].params);let result = lower(&mut cx, param_ty);unsafe { flags.set_may_leave(true) };- result?;-- // If needed, flag a post-return call being required as we're about to- // enter wasm and afterwards need a post-return.- unsafe {- if !(call_post_return_automatically && async_) {- flags.set_needs_post_return(true);- }- }-- Ok(())+ result}/// Creates a `LiftContext` using the configuration values with this lifted@@ -1009,3 +904,33 @@ impl TaskExit {_ = self.0.await;}}++pub(crate) unsafe fn call_post_return(+ mut store: impl AsContextMut,+ func: Option<NonNull<VMFuncRef>>,+ arg: ValRaw,+ mut flags: InstanceFlags,+) -> Result<()> {+ unsafe {+ // Post return functions are forbidden from calling imports or+ // intrinsics.+ flags.set_may_leave(false);++ // If the function actually had a `post-return` configured in its+ // canonical options that's executed here.+ if let Some(func) = func {+ crate::Func::call_unchecked_raw(+ &mut store.as_context_mut(),+ func,+ core::slice::from_ref(&arg).into(),+ )?;+ }++ // And finally if everything completed successfully then the "may+ // leave" flags is set to `true` again here which enables further+ // use of the component.+ flags.set_may_leave(true);+ }++ Ok(())+}diff --git a/crates/wasmtime/src/runtime/component/func/typed.rs b/crates/wasmtime/src/runtime/component/func/typed.rsindex c03d08a97b..a8dd6607f7 100644--- a/crates/wasmtime/src/runtime/component/func/typed.rs+++ b/crates/wasmtime/src/runtime/component/func/typed.rs@@ -112,20 +112,8 @@ where/// memory leaks in wasm itself. The `post-return` canonical abi option is/// used to configured this.///- /// To accommodate this feature of the component model after invoking a- /// function via [`TypedFunc::call`] you must next invoke- /// [`TypedFunc::post_return`]. Note that the return value of the function- /// should be processed between these two function calls. The return value- /// continues to be usable from an embedder's perspective after- /// `post_return` is called, but after `post_return` is invoked it may no- /// longer retain the same value that the wasm module originally returned.- ///- /// Also note that [`TypedFunc::post_return`] must be invoked irrespective- /// of whether the canonical ABI option `post-return` was configured or not.- /// This means that embedders must unconditionally call- /// [`TypedFunc::post_return`] when a function returns. If this function- /// call returns an error, however, then [`TypedFunc::post_return`] is not- /// required.+ /// If a post-return function is present, it will be called automatically by+ /// this function.////// # Errors///@@ -138,8 +126,6 @@ where/// * If the wasm returns a value which violates the canonical ABI./// * If this function's instances cannot be entered, for example if the/// instance is currently calling a host function.- /// * If a previous function call occurred and the corresponding- /// `post_return` hasn't been invoked yet./// * If `store` requires using [`Self::call_async`] instead, see/// [crate documentation](crate#async) for more info.///@@ -158,9 +144,9 @@ where////// Panics if `store` does not own this function.pub fn call(&self, mut store: impl AsContextMut, params: Params) -> Result<Return> {- let store = store.as_context_mut();+ let mut store = store.as_context_mut();store.0.validate_sync_call()?;- self.call_impl(store, params)+ self.call_impl(store.as_context_mut(), params)}/// Exactly like [`Self::call`], except for invoking WebAssembly@@ -188,7 +174,7 @@ wherelet ptr = SendSyncPtr::from(NonNull::from(¶ms).cast::<u8>());let prepared =- self.prepare_call(store.as_context_mut(), true, false, move |cx, ty, dst| {+ self.prepare_call(store.as_context_mut(), true, move |cx, ty, dst| {// SAFETY: The goal here is to get `Params`, a non-`'static`// value, to live long enough to the lowering of the// parameters. We're guaranteed that `Params` lives in the@@ -251,8 +237,7 @@ where/// exclusive access to the store until the completion of the call), calls/// made using this method may run concurrently with other calls to the same/// instance. In addition, the runtime will call the `post-return` function- /// (if any) automatically when the guest task completes -- no need to- /// explicitly call `Func::post_return` afterward.+ /// (if any) automatically when the guest task completes.////// Besides the task's return value, this returns a [`TaskExit`]/// representing the completion of the guest task and any transitive@@ -326,7 +311,7 @@ where);let prepared =- self.prepare_call(store.as_context_mut(), false, true, move |cx, ty, dst| {+ self.prepare_call(store.as_context_mut(), false, move |cx, ty, dst| {Self::lower_args(cx, ty, dst, ¶ms)})?;concurrent::queue_call(store, prepared)@@ -364,7 +349,6 @@ whereself,store: StoreContextMut<'_, T>,host_future_present: bool,- call_post_return_automatically: bool,lower: impl FnOnce(&mut LowerContext<T>,InterfaceType,@@ -395,11 +379,8 @@ whereself.func,param_count,host_future_present,- call_post_return_automatically,move |func, store, params_out| {- func.with_lower_context(store, call_post_return_automatically, |cx, ty| {- lower(cx, ty, params_out)- })+ func.with_lower_context(store, |cx, ty| lower(cx, ty, params_out))},move |func, store, results| {let result = if Return::flatten_count() <= max_results {@@ -435,7 +416,7 @@ where}fn call_impl(&self, mut store: impl AsContextMut, params: Params) -> Result<Return> {- let store = store.as_context_mut();+ let mut store = store.as_context_mut();if self.func.abi_async(store.0) {bail!("must enable the `component-model-async` feature to call async-lifted exports")@@ -458,7 +439,7 @@ where// safety requirements of `Lift` and `Lower` on `Params` and `Return` in// combination with checking the various possible branches here and// dispatching to appropriately typed functions.- unsafe {+ let (result, post_return_arg) = unsafe {// This type is used as `LowerParams` for `call_raw` which is either// `Params::Lower` or `ValRaw` representing it's either on the stack// or it's on the heap. This allocates 1 extra `ValRaw` on the stack@@ -473,7 +454,7 @@ whereif Return::flatten_count() <= MAX_FLAT_RESULTS {self.func.call_raw(- store,+ store.as_context_mut(),|cx, ty, dst: &mut MaybeUninit<Union<Params::Lower, ValRaw>>| {let dst = storage_as_slice_mut(dst);Self::lower_args(cx, ty, dst, ¶ms)@@ -482,7 +463,7 @@ where)} else {self.func.call_raw(- store,+ store.as_context_mut(),|cx, ty, dst: &mut MaybeUninit<Union<Params::Lower, ValRaw>>| {let dst = storage_as_slice_mut(dst);Self::lower_args(cx, ty, dst, ¶ms)@@ -490,7 +471,11 @@ whereSelf::lift_heap_result,)}- }+ }?;++ self.func.post_return_impl(store, post_return_arg)?;++ Ok(result)}/// Lower parameters directly onto the stack specified by the `dst`@@ -581,18 +566,20 @@ whereReturn::linear_lift_from_memory(cx, ty, bytes)}- /// See [`Func::post_return`]- pub fn post_return(&self, store: impl AsContextMut) -> Result<()> {- self.func.post_return(store)+ #[doc(hidden)]+ #[deprecated(note = "no longer needs to be called; this function has no effect")]+ pub fn post_return(&self, _store: impl AsContextMut) -> Result<()> {+ Ok(())}- /// See [`Func::post_return_async`]+ #[doc(hidden)]+ #[deprecated(note = "no longer needs to be called; this function has no effect")]#[cfg(feature = "async")]pub async fn post_return_async<T: Send>(&self,- store: impl AsContextMut<Data = T>,+ _store: impl AsContextMut<Data = T>,) -> Result<()> {- self.func.post_return_async(store).await+ Ok(())}}diff --git a/crates/wasmtime/src/runtime/component/store.rs b/crates/wasmtime/src/runtime/component/store.rsindex 9402c209e1..0b2d571aa5 100644--- a/crates/wasmtime/src/runtime/component/store.rs+++ b/crates/wasmtime/src/runtime/component/store.rs@@ -34,23 +34,6 @@ impl StoreOpaque {pub(crate) fn set_trapped(&mut self) {self.store_data_mut().components.trapped = true;}-- /// Returns `false` if the specified instance may not be entered, regardless- /// of what's on a task's call stack.- ///- /// If this returns `true`, the instance may be entered as long as it isn't- /// on the task's call stack, if applicable.- pub(crate) fn may_enter_at_all(&mut self, instance: RuntimeInstance) -> bool {- if self.trapped() {- return false;- }-- let flags = self- .component_instance(instance.instance)- .instance_flags(instance.index);-- unsafe { !flags.needs_post_return() }- }}impl StoreData {diff --git a/crates/wasmtime/src/runtime/vm/component.rs b/crates/wasmtime/src/runtime/vm/component.rsindex ed295cca0a..dfedb1b2fb 100644--- a/crates/wasmtime/src/runtime/vm/component.rs+++ b/crates/wasmtime/src/runtime/vm/component.rs@@ -148,12 +148,6 @@ pub struct ComponentInstance {/// Self-pointer back to `Store<T>` and its functions.store: VMStoreRawPtr,- /// Cached ABI return value from the last-invoked function call along with- /// the function index that was invoked.- ///- /// Used in `post_return_arg_set` and `post_return_arg_take` below.- post_return_arg: Option<(ExportIndex, ValRaw)>,-/// Required by `InstanceLayout`, also required to be the last field (with/// repr(C))vmctx: OwnedVMContext<VMComponentContext>,@@ -341,7 +335,6 @@ impl ComponentInstance {resource_types,imports: imports.clone(),store: VMStoreRawPtr(store),- post_return_arg: None,vmctx: OwnedVMContext::new(),})?;unsafe {@@ -954,50 +947,6 @@ impl ComponentInstance {}}- /// Sets the cached argument for the canonical ABI option `post-return` to- /// the `arg` specified.- ///- /// This function is used in conjunction with function calls to record,- /// after a function call completes, the optional ABI return value. This- /// return value is cached within this instance for future use when the- /// `post_return` Rust-API-level function is invoked.- ///- /// Note that `index` here is the index of the export that was just- /// invoked, and this is used to ensure that `post_return` is called on the- /// same function afterwards. This restriction technically isn't necessary- /// though and may be one we want to lift in the future.- ///- /// # Panics- ///- /// This function will panic if `post_return_arg` is already set to `Some`.- pub fn post_return_arg_set(self: Pin<&mut Self>, index: ExportIndex, arg: ValRaw) {- assert!(self.post_return_arg.is_none());- *self.post_return_arg_mut() = Some((index, arg));- }-- /// Re-acquires the value originally saved via `post_return_arg_set`.- ///- /// This function will take a function `index` that's having its- /// `post_return` function called. If an argument was previously stored and- /// `index` matches the index that was stored then `Some(arg)` is returned.- /// Otherwise `None` is returned.- pub fn post_return_arg_take(self: Pin<&mut Self>, index: ExportIndex) -> Option<ValRaw> {- let post_return_arg = self.post_return_arg_mut();- let (expected_index, arg) = post_return_arg.take()?;- if index != expected_index {- *post_return_arg = Some((expected_index, arg));- None- } else {- Some(arg)- }- }-- fn post_return_arg_mut(self: Pin<&mut Self>) -> &mut Option<(ExportIndex, ValRaw)> {- // SAFETY: we've chosen the `Pin` guarantee of `Self` to not apply to- // the map returned.- unsafe { &mut self.get_unchecked_mut().post_return_arg }- }-pub(crate) fn check_may_leave(&self,instance: RuntimeComponentInstanceIndex,@@ -1124,22 +1073,6 @@ impl InstanceFlags {}}- #[inline]- pub unsafe fn needs_post_return(&self) -> bool {- unsafe { *self.as_raw().as_ref().as_i32() & FLAG_NEEDS_POST_RETURN != 0 }- }-- #[inline]- pub unsafe fn set_needs_post_return(&mut self, val: bool) {- unsafe {- if val {- *self.as_raw().as_mut().as_i32_mut() |= FLAG_NEEDS_POST_RETURN;- } else {- *self.as_raw().as_mut().as_i32_mut() &= !FLAG_NEEDS_POST_RETURN;- }- }- }-#[inline]pub fn as_raw(&self) -> NonNull<VMGlobalDefinition> {self.0.as_non_null()diff --git a/crates/wast/src/wast.rs b/crates/wast/src/wast.rsindex c37be5c67d..48cec7a225 100644--- a/crates/wast/src/wast.rs+++ b/crates/wast/src/wast.rs@@ -310,17 +310,7 @@ impl WastContext {None => func.call(&mut *store, &values, &mut results),};Ok(match result {- Ok(()) => {- let result = match &replace.rt {- Some(rt) => rt.block_on(func.post_return_async(&mut *store)),- None => func.post_return(&mut *store),- };-- match result {- Ok(()) => Outcome::Ok(Results::Component(results)),- Err(e) => Outcome::Trap(e),- }- }+ Ok(()) => Outcome::Ok(Results::Component(results)),Err(e) => Outcome::Trap(e),})}diff --git a/crates/wit-bindgen/src/lib.rs b/crates/wit-bindgen/src/lib.rsindex 88a614eff2..47550d804a 100644--- a/crates/wit-bindgen/src/lib.rs+++ b/crates/wit-bindgen/src/lib.rs@@ -2854,19 +2854,6 @@ impl<'a> InterfaceGenerator<'a> {};uwriteln!(self.src, ")){instrument}{await_}?;");- let instrument = if flags.contains(FunctionFlags::ASYNC | FunctionFlags::TRACING) {- ".instrument(span)"- } else {- ""- };-- if !flags.contains(FunctionFlags::STORE) {- uwriteln!(- self.src,- "callee.post_return{async__}(store.as_context_mut()){instrument}{await_}?;"- );- }-self.src.push_str("Ok(");if task_exit {self.src.push_str("(");diff --git a/crates/wizer/src/component/wasmtime.rs b/crates/wizer/src/component/wasmtime.rsindex b5785b821c..df337456ca 100644--- a/crates/wizer/src/component/wasmtime.rs+++ b/crates/wizer/src/component/wasmtime.rs@@ -70,10 +70,6 @@ impl Wizer {.call_async(&mut *store, ()).await.with_context(|| format!("the initialization function trapped"))?;- init_func- .post_return_async(&mut *store)- .await- .context("failed to call post-return")?;Ok(())}@@ -111,9 +107,7 @@ impl<T: Send> WasmtimeWizerComponent<'_, T> {.get_typed_func::<(), (R,)>(&mut *self.store, func_export).unwrap();let ret = func.call_async(&mut *self.store, ()).await.unwrap().0;- let ret = use_ret(&mut *self.store, ret);- func.post_return_async(&mut *self.store).await.unwrap();- ret+ use_ret(&mut *self.store, ret)}}diff --git a/examples/wasip2/main.rs b/examples/wasip2/main.rsindex 878e31c8f7..22dfaae889 100644--- a/examples/wasip2/main.rs+++ b/examples/wasip2/main.rs@@ -81,7 +81,5 @@ fn main() -> Result<()> {// * Documentation for [Func::typed](https://docs.rs/wasmtime/latest/wasmtime/component/struct.Func.html#method.typed) and [ComponentNamedList](https://docs.rs/wasmtime/latest/wasmtime/component/trait.ComponentNamedList.html)let typed = func.typed::<(), (Result<(), ()>,)>(&store)?;let (result,) = typed.call(&mut store, ())?;- // Required, see documentation of TypedFunc::call- typed.post_return(&mut store)?;result.map_err(|_| wasmtime::format_err!("error"))}diff --git a/src/commands/run.rs b/src/commands/run.rsindex e3ce0e9a0a..3b311864ef 100644--- a/src/commands/run.rs+++ b/src/commands/run.rs@@ -645,7 +645,6 @@ impl RunCommand {}func.call_async(&mut *store, ¶ms, results).await?;- func.post_return_async(&mut *store).await?;Ok(())}diff --git a/tests/all/component_model.rs b/tests/all/component_model.rsindex 4ad94b84eb..d2efd3e704 100644--- a/tests/all/component_model.rs+++ b/tests/all/component_model.rs@@ -1,9 +1,11 @@use std::fmt::Write;use std::iter;-use wasmtime::Result;-use wasmtime::component::Component;+use wasmtime::component::{+ Component, ComponentNamedList, Instance, Lift, Linker, Lower, ResourceAny, TypedFunc,+};+use wasmtime::{Config, Result, Store};use wasmtime_component_util::REALLOC_AND_FREE;-use wasmtime_test_util::component::{TypedFuncExt, async_engine, config, engine};+use wasmtime_test_util::component::{async_engine, config, engine};mod aot;mod r#async;@@ -22,6 +24,78 @@ mod post_return;mod resources;mod strings;+#[derive(Copy, Clone)]+enum ApiStyle {+ Sync,+ Async,+ AsyncNotConcurrent,+ Concurrent,+}++impl ApiStyle {+ fn config(self) -> Config {+ let mut config = config();+ match self {+ ApiStyle::AsyncNotConcurrent => {+ config.concurrency_support(false);+ }+ ApiStyle::Sync | ApiStyle::Async | ApiStyle::Concurrent => {+ config.wasm_component_model_threading(true);+ }+ }+ config+ }++ async fn instantiate<T: Send>(+ self,+ store: &mut Store<T>,+ linker: &Linker<T>,+ component: &Component,+ ) -> Result<Instance> {+ match self {+ ApiStyle::Sync => linker.instantiate(store, &component),+ ApiStyle::Async | ApiStyle::AsyncNotConcurrent | ApiStyle::Concurrent => {+ linker.instantiate_async(store, &component).await+ }+ }+ }++ async fn call<+ P: ComponentNamedList + Lower + 'static,+ R: ComponentNamedList + Lift + 'static,+ T: Send,+ >(+ self,+ store: &mut Store<T>,+ func: TypedFunc<P, R>,+ params: P,+ ) -> Result<R> {+ match self {+ ApiStyle::Sync => func.call(&mut *store, params),+ ApiStyle::Async | ApiStyle::AsyncNotConcurrent => {+ func.call_async(&mut *store, params).await+ }+ ApiStyle::Concurrent => Ok(store+ .run_concurrent(async |access| func.call_concurrent(access, params).await)+ .await??+ .0),+ }+ }++ async fn resource_drop<T: Send>(+ self,+ store: &mut Store<T>,+ resource: ResourceAny,+ ) -> Result<()> {+ match self {+ ApiStyle::Sync => resource.resource_drop(store),+ ApiStyle::Async | ApiStyle::AsyncNotConcurrent | ApiStyle::Concurrent => {+ resource.resource_drop_async(store).await+ }+ }+ }+}+#[test]#[cfg_attr(miri, ignore)]fn components_importing_modules() -> Result<()> {diff --git a/tests/all/component_model/async.rs b/tests/all/component_model/async.rsindex 7e71ccd38e..949639e1dd 100644--- a/tests/all/component_model/async.rs+++ b/tests/all/component_model/async.rs@@ -2,7 +2,7 @@ use crate::async_functions::{PollOnce, execute_across_threads};use std::pin::Pin;use std::task::{Context, Poll};use wasmtime::Result;-use wasmtime::{AsContextMut, Config, component::*};+use wasmtime::{Config, component::*};use wasmtime::{Engine, Store, StoreContextMut, Trap};use wasmtime_component_util::REALLOC_AND_FREE;@@ -36,7 +36,6 @@ async fn smoke() -> Result<()> {let thunk = instance.get_typed_func::<(), ()>(&mut store, "thunk")?;thunk.call_async(&mut store, ()).await?;- thunk.post_return_async(&mut store).await?;let err = instance.get_typed_func::<(), ()>(&mut store, "thunk-trap")?@@ -88,7 +87,6 @@ async fn smoke_func_wrap() -> Result<()> {let thunk = instance.get_typed_func::<(), ()>(&mut store, "thunk")?;thunk.call_async(&mut store, ()).await?;- thunk.post_return_async(&mut store).await?;Ok(())}@@ -305,7 +303,6 @@ async fn drop_resource_async() -> Result<()> {execute_across_threads(async move {let resource = Resource::new_own(100);f.call_async(&mut store, (resource,)).await?;- f.post_return_async(&mut store).await?;Ok::<_, wasmtime::Error>(())}).await?;@@ -664,7 +661,6 @@ async fn task_deletion() -> Result<()> {for func in funcs {let func = instance.get_typed_func::<(), (u32,)>(&mut store, func)?;assert_eq!(func.call_async(&mut store, ()).await?, (42,));- func.post_return_async(store.as_context_mut()).await?;}Ok(())diff --git a/tests/all/component_model/async_dynamic.rs b/tests/all/component_model/async_dynamic.rsindex 860777d1e7..33740084f2 100644--- a/tests/all/component_model/async_dynamic.rs+++ b/tests/all/component_model/async_dynamic.rs@@ -136,13 +136,9 @@ fn simple_type_assertions() -> Result<()> {let roundtrip = |store: &mut Store<()>, f: FutureReader<u32>| -> Result<()> {let (f,) = f_t_t.call(&mut *store, (f,))?;- f_t_t.post_return(&mut *store)?;let (f,) = f_t_a.call(&mut *store, (f,))?;- f_t_a.post_return(&mut *store)?;let (f,) = f_a_a.call(&mut *store, (f,))?;- f_a_a.post_return(&mut *store)?;let (mut f,) = f_a_t.call(&mut *store, (f,))?;- f_a_t.post_return(&mut *store)?;f.close(&mut *store);Ok(())};@@ -151,23 +147,17 @@ fn simple_type_assertions() -> Result<()> {roundtrip(&mut store, f)?;let (f,) = mk_f_t.call(&mut store, ())?;- mk_f_t.post_return(&mut store)?;roundtrip(&mut store, f)?;let (f,) = mk_f_a.call(&mut store, ())?;- mk_f_a.post_return(&mut store)?;let f = f.try_into_future_reader::<u32>()?;roundtrip(&mut store, f)?;let roundtrip = |store: &mut Store<()>, s: StreamReader<u32>| -> Result<()> {let (s,) = s_t_t.call(&mut *store, (s,))?;- s_t_t.post_return(&mut *store)?;let (s,) = s_t_a.call(&mut *store, (s,))?;- s_t_a.post_return(&mut *store)?;let (s,) = s_a_a.call(&mut *store, (s,))?;- s_a_a.post_return(&mut *store)?;let (mut s,) = s_a_t.call(&mut *store, (s,))?;- s_a_t.post_return(&mut *store)?;s.close(&mut *store);Ok(())};@@ -176,11 +166,9 @@ fn simple_type_assertions() -> Result<()> {roundtrip(&mut store, s)?;let (s,) = mk_s_t.call(&mut store, ())?;- mk_s_t.post_return(&mut store)?;roundtrip(&mut store, s)?;let (s,) = mk_s_a.call(&mut store, ())?;- mk_s_a.post_return(&mut store)?;let s = s.try_into_stream_reader::<u32>()?;roundtrip(&mut store, s)?;diff --git a/tests/all/component_model/call_hook.rs b/tests/all/component_model/call_hook.rsindex 72602d2220..4d5ca9d524 100644--- a/tests/all/component_model/call_hook.rs+++ b/tests/all/component_model/call_hook.rs@@ -59,7 +59,6 @@ fn call_wrapped_func() -> Result<()> {.expect("looking up `export`");export.call(&mut store, ())?;- export.post_return(&mut store)?;let s = store.into_data();assert_eq!(s.calls_into_host, 1);@@ -126,8 +125,6 @@ fn call_func_with_realloc() -> Result<()> {let result = res.to_str(&store)?;assert_eq!(&message, &result);- export.post_return(&mut store)?;-// There are two wasm calls for the `list8-to-str` call and the guest realloc call for the list// argument.let s = store.into_data();@@ -173,12 +170,6 @@ fn call_func_with_post_return() -> Result<()> {export.call(&mut store, ())?;- // Before post-return, there will only have been one call into wasm.- assert_eq!(store.data().calls_into_wasm, 1);- assert_eq!(store.data().returns_from_wasm, 1);-- export.post_return(&mut store)?;-// There are no host calls in this example, but the post-return does increment the count of// wasm calls by 1, putting the total number of wasm calls at 2.let s = store.into_data();@@ -244,7 +235,6 @@ async fn call_wrapped_async_func() -> Result<()> {.expect("looking up `export`");export.call_async(&mut store, ()).await?;- export.post_return_async(&mut store).await?;let s = store.into_data();assert_eq!(s.calls_into_host, 1);@@ -330,7 +320,6 @@ fn trapping() -> Result<()> {let mut r = export.call(&mut store, (action,));if r.is_ok() && again {- export.post_return(&mut store).unwrap();r = export.call(&mut store, (action,));}(store.into_data(), r.err())diff --git a/tests/all/component_model/dynamic.rs b/tests/all/component_model/dynamic.rsindex 17be5371f9..0a67a320f8 100644--- a/tests/all/component_model/dynamic.rs+++ b/tests/all/component_model/dynamic.rs@@ -6,7 +6,6 @@ use wasmtime::component::types::{self, Case, ComponentItem, Field};use wasmtime::component::{Component, Linker, ResourceType, Val};use wasmtime::{Module, Store};use wasmtime_component_util::REALLOC_AND_FREE;-use wasmtime_test_util::component::FuncExt;#[test]fn primitives() -> Result<()> {@@ -39,7 +38,7 @@ fn primitives() -> Result<()> {let component = Component::new(&engine, make_echo_component_with_params(ty, &[param]))?;let instance = Linker::new(&engine).instantiate(&mut store, &component)?;let func = instance.get_func(&mut store, "echo").unwrap();- func.call_and_post_return(&mut store, &[input.clone()], &mut output)?;+ func.call(&mut store, &[input.clone()], &mut output)?;assert_eq!(input, output[0]);}@@ -53,7 +52,7 @@ fn primitives() -> Result<()> {let instance = Linker::new(&engine).instantiate(&mut store, &component)?;let func = instance.get_func(&mut store, "echo").unwrap();let err = func- .call_and_post_return(&mut store, &[Val::U64(42)], &mut output)+ .call(&mut store, &[Val::U64(42)], &mut output).unwrap_err();assert!(err.to_string().contains("type mismatch"), "{err}");@@ -61,7 +60,7 @@ fn primitives() -> Result<()> {// Sad path: arity mismatch (too many)let err = func- .call_and_post_return(+ .call(&mut store,&[Val::Float64(3.14159265), Val::Float64(3.14159265)],&mut output,@@ -75,17 +74,13 @@ fn primitives() -> Result<()> {// Sad path: arity mismatch (too few)- let err = func- .call_and_post_return(&mut store, &[], &mut output)- .unwrap_err();+ let err = func.call(&mut store, &[], &mut output).unwrap_err();assert!(err.to_string().contains("expected 1 argument(s), got 0"),"{err}");- let err = func- .call_and_post_return(&mut store, &output, &mut [])- .unwrap_err();+ let err = func.call(&mut store, &output, &mut []).unwrap_err();assert!(err.to_string().contains("expected 1 result(s), got 0"),"{err}"@@ -104,7 +99,7 @@ fn strings() -> Result<()> {let func = instance.get_func(&mut store, "echo").unwrap();let input = Val::String("hello, component!".into());let mut output = [Val::Bool(false)];- func.call_and_post_return(&mut store, &[input.clone()], &mut output)?;+ func.call(&mut store, &[input.clone()], &mut output)?;assert_eq!(input, output[0]);Ok(())@@ -124,7 +119,7 @@ fn lists() -> Result<()> {Val::U32(2084037802),]);let mut output = [Val::Bool(false)];- func.call_and_post_return(&mut store, &[input.clone()], &mut output)?;+ func.call(&mut store, &[input.clone()], &mut output)?;assert_eq!(input, output[0]);@@ -135,9 +130,7 @@ fn lists() -> Result<()> {Val::U32(79023439),Val::Float32(3.14159265),]);- let err = func- .call_and_post_return(&mut store, &[err], &mut output)- .unwrap_err();+ let err = func.call(&mut store, &[err], &mut output).unwrap_err();assert!(err.to_string().contains("type mismatch"), "{err}");Ok(())@@ -185,7 +178,7 @@ fn records() -> Result<()> {),]);let mut output = [Val::Bool(false)];- func.call_and_post_return(&mut store, &[input.clone()], &mut output)?;+ func.call(&mut store, &[input.clone()], &mut output)?;assert_eq!(input, output[0]);@@ -204,9 +197,7 @@ fn records() -> Result<()> {]);let instance = Linker::new(&engine).instantiate(&mut store, &component)?;let func = instance.get_func(&mut store, "echo").unwrap();- let err = func- .call_and_post_return(&mut store, &[err], &mut output)- .unwrap_err();+ let err = func.call(&mut store, &[err], &mut output).unwrap_err();assert!(err.to_string().contains("type mismatch"), "{err}");// Sad path: too many fields@@ -225,9 +216,7 @@ fn records() -> Result<()> {]);let instance = Linker::new(&engine).instantiate(&mut store, &component)?;let func = instance.get_func(&mut store, "echo").unwrap();- let err = func- .call_and_post_return(&mut store, &[err], &mut output)- .unwrap_err();+ let err = func.call(&mut store, &[err], &mut output).unwrap_err();assert!(err.to_string().contains("expected 3 fields, got 4"),"{err}"@@ -241,9 +230,7 @@ fn records() -> Result<()> {]);let instance = Linker::new(&engine).instantiate(&mut store, &component)?;let func = instance.get_func(&mut store, "echo").unwrap();- let err = func- .call_and_post_return(&mut store, &[err], &mut output)- .unwrap_err();+ let err = func.call(&mut store, &[err], &mut output).unwrap_err();assert!(err.to_string().contains("expected 3 fields, got 2"),"{err}"@@ -282,7 +269,7 @@ fn variants() -> Result<()> {let func = instance.get_func(&mut store, "echo").unwrap();let input = Val::Variant("B".into(), Some(Box::new(Val::Float64(3.14159265))));let mut output = [Val::Bool(false)];- func.call_and_post_return(&mut store, &[input.clone()], &mut output)?;+ func.call(&mut store, &[input.clone()], &mut output)?;assert_eq!(input, output[0]);@@ -308,7 +295,7 @@ fn variants() -> Result<()> {("E".into(), Val::U32(314159265)),]))),);- func.call_and_post_return(&mut store, &[input.clone()], &mut output)?;+ func.call(&mut store, &[input.clone()], &mut output)?;assert_eq!(input, output[0]);@@ -317,17 +304,13 @@ fn variants() -> Result<()> {let instance = Linker::new(&engine).instantiate(&mut store, &component)?;let func = instance.get_func(&mut store, "echo").unwrap();let err = Val::Variant("B".into(), Some(Box::new(Val::U64(314159265))));- let err = func- .call_and_post_return(&mut store, &[err], &mut output)- .unwrap_err();+ let err = func.call(&mut store, &[err], &mut output).unwrap_err();assert!(err.to_string().contains("type mismatch"), "{err}");let instance = Linker::new(&engine).instantiate(&mut store, &component)?;let func = instance.get_func(&mut store, "echo").unwrap();let err = Val::Variant("B".into(), None);- let err = func- .call_and_post_return(&mut store, &[err], &mut output)- .unwrap_err();+ let err = func.call(&mut store, &[err], &mut output).unwrap_err();assert!(err.to_string().contains("expected a payload for case `B`"),"{err}"@@ -338,17 +321,13 @@ fn variants() -> Result<()> {let instance = Linker::new(&engine).instantiate(&mut store, &component)?;let func = instance.get_func(&mut store, "echo").unwrap();let err = Val::Variant("D".into(), Some(Box::new(Val::U64(314159265))));- let err = func- .call_and_post_return(&mut store, &[err], &mut output)- .unwrap_err();+ let err = func.call(&mut store, &[err], &mut output).unwrap_err();assert!(err.to_string().contains("unknown variant case"), "{err}");let instance = Linker::new(&engine).instantiate(&mut store, &component)?;let func = instance.get_func(&mut store, "echo").unwrap();let err = Val::Variant("D".into(), None);- let err = func- .call_and_post_return(&mut store, &[err], &mut output)- .unwrap_err();+ let err = func.call(&mut store, &[err], &mut output).unwrap_err();assert!(err.to_string().contains("unknown variant case"), "{err}");// Make sure we lift variants which have cases of different sizes with the correct alignment@@ -387,7 +366,7 @@ fn variants() -> Result<()> {),("B".into(), Val::U32(628318530)),]);- func.call_and_post_return(&mut store, &[input.clone()], &mut output)?;+ func.call(&mut store, &[input.clone()], &mut output)?;assert_eq!(input, output[0]);@@ -410,16 +389,14 @@ fn flags() -> Result<()> {let func = instance.get_func(&mut store, "echo").unwrap();let input = Val::Flags(vec!["B".into(), "D".into()]);let mut output = [Val::Bool(false)];- func.call_and_post_return(&mut store, &[input.clone()], &mut output)?;+ func.call(&mut store, &[input.clone()], &mut output)?;assert_eq!(input, output[0]);// Sad path: unknown flagslet err = Val::Flags(vec!["B".into(), "D".into(), "F".into()]);- let err = func- .call_and_post_return(&mut store, &[err], &mut output)- .unwrap_err();+ let err = func.call(&mut store, &[err], &mut output).unwrap_err();assert!(err.to_string().contains("unknown flag"), "{err}");Ok(())@@ -539,7 +516,7 @@ fn everything() -> Result<()> {),]);let mut output = [Val::Bool(false)];- func.call_and_post_return(&mut store, &[input.clone()], &mut output)?;+ func.call(&mut store, &[input.clone()], &mut output)?;assert_eq!(input, output[0]);diff --git a/tests/all/component_model/func.rs b/tests/all/component_model/func.rsindex 2bc1d6ad02..fd13a8b218 100644--- a/tests/all/component_model/func.rs+++ b/tests/all/component_model/func.rs@@ -1,6 +1,6 @@#![cfg(not(miri))]-use super::{REALLOC_AND_FREE, TypedFuncExt};+use super::{ApiStyle, REALLOC_AND_FREE};use std::sync::Arc;use wasmtime::Result;use wasmtime::component::*;@@ -33,7 +33,7 @@ fn thunks() -> Result<()> {let instance = Linker::new(&engine).instantiate(&mut store, &component)?;instance.get_typed_func::<(), ()>(&mut store, "thunk")?- .call_and_post_return(&mut store, ())?;+ .call(&mut store, ())?;let err = instance.get_typed_func::<(), ()>(&mut store, "thunk-trap")?.call(&mut store, ())@@ -188,28 +188,28 @@ fn integers() -> Result<()> {// Passing in 100 is valid for all primitivesinstance.get_typed_func::<(u8,), ()>(&mut store, "take-u8")?- .call_and_post_return(&mut store, (100,))?;+ .call(&mut store, (100,))?;instance.get_typed_func::<(i8,), ()>(&mut store, "take-s8")?- .call_and_post_return(&mut store, (100,))?;+ .call(&mut store, (100,))?;instance.get_typed_func::<(u16,), ()>(&mut store, "take-u16")?- .call_and_post_return(&mut store, (100,))?;+ .call(&mut store, (100,))?;instance.get_typed_func::<(i16,), ()>(&mut store, "take-s16")?- .call_and_post_return(&mut store, (100,))?;+ .call(&mut store, (100,))?;instance.get_typed_func::<(u32,), ()>(&mut store, "take-u32")?- .call_and_post_return(&mut store, (100,))?;+ .call(&mut store, (100,))?;instance.get_typed_func::<(i32,), ()>(&mut store, "take-s32")?- .call_and_post_return(&mut store, (100,))?;+ .call(&mut store, (100,))?;instance.get_typed_func::<(u64,), ()>(&mut store, "take-u64")?- .call_and_post_return(&mut store, (100,))?;+ .call(&mut store, (100,))?;instance.get_typed_func::<(i64,), ()>(&mut store, "take-s64")?- .call_and_post_return(&mut store, (100,))?;+ .call(&mut store, (100,))?;// This specific wasm instance traps if any value other than 100 is passedwith_new_instance(&engine, &component, |store, instance| {@@ -273,49 +273,49 @@ fn integers() -> Result<()> {assert_eq!(instance.get_typed_func::<(), (u8,)>(&mut store, "ret-u8")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0,));assert_eq!(instance.get_typed_func::<(), (i8,)>(&mut store, "ret-s8")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0,));assert_eq!(instance.get_typed_func::<(), (u16,)>(&mut store, "ret-u16")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0,));assert_eq!(instance.get_typed_func::<(), (i16,)>(&mut store, "ret-s16")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0,));assert_eq!(instance.get_typed_func::<(), (u32,)>(&mut store, "ret-u32")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0,));assert_eq!(instance.get_typed_func::<(), (i32,)>(&mut store, "ret-s32")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0,));assert_eq!(instance.get_typed_func::<(), (u64,)>(&mut store, "ret-u64")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0,));assert_eq!(instance.get_typed_func::<(), (i64,)>(&mut store, "ret-s64")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0,));@@ -323,49 +323,49 @@ fn integers() -> Result<()> {assert_eq!(instance.get_typed_func::<(), (u8,)>(&mut store, "retm1-u8")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0xff,));assert_eq!(instance.get_typed_func::<(), (i8,)>(&mut store, "retm1-s8")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(-1,));assert_eq!(instance.get_typed_func::<(), (u16,)>(&mut store, "retm1-u16")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0xffff,));assert_eq!(instance.get_typed_func::<(), (i16,)>(&mut store, "retm1-s16")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(-1,));assert_eq!(instance.get_typed_func::<(), (u32,)>(&mut store, "retm1-u32")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0xffffffff,));assert_eq!(instance.get_typed_func::<(), (i32,)>(&mut store, "retm1-s32")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(-1,));assert_eq!(instance.get_typed_func::<(), (u64,)>(&mut store, "retm1-u64")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(0xffffffff_ffffffff,));assert_eq!(instance.get_typed_func::<(), (i64,)>(&mut store, "retm1-s64")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(-1,));@@ -374,37 +374,37 @@ fn integers() -> Result<()> {assert_eq!(instance.get_typed_func::<(), (u8,)>(&mut store, "retbig-u8")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(ret as u8,),);assert_eq!(instance.get_typed_func::<(), (i8,)>(&mut store, "retbig-s8")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(ret as i8,),);assert_eq!(instance.get_typed_func::<(), (u16,)>(&mut store, "retbig-u16")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(ret as u16,),);assert_eq!(instance.get_typed_func::<(), (i16,)>(&mut store, "retbig-s16")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(ret as i16,),);assert_eq!(instance.get_typed_func::<(), (u32,)>(&mut store, "retbig-u32")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(ret,),);assert_eq!(instance.get_typed_func::<(), (i32,)>(&mut store, "retbig-s32")?- .call_and_post_return(&mut store, ())?,+ .call(&mut store, ())?,(ret as i32,),);@@ -436,16 +436,16 @@ fn type_layers() -> Result<()> {instance.get_typed_func::<(Box<u32>,), ()>(&mut store, "take-u32")?- .call_and_post_return(&mut store, (Box::new(2),))?;+ .call(&mut store, (Box::new(2),))?;instance.get_typed_func::<(&u32,), ()>(&mut store, "take-u32")?- .call_and_post_return(&mut store, (&2,))?;+ .call(&mut store, (&2,))?;instance.get_typed_func::<(Arc<u32>,), ()>(&mut store, "take-u32")?- .call_and_post_return(&mut store, (Arc::new(2),))?;+ .call(&mut store, (Arc::new(2),))?;instance.get_typed_func::<(&Box<Arc<Box<u32>>>,), ()>(&mut store, "take-u32")?- .call_and_post_return(&mut store, (&Box::new(Arc::new(Box::new(2))),))?;+ .call(&mut store, (&Box::new(Arc::new(Box::new(2))),))?;Ok(())}@@ -499,13 +499,9 @@ fn floats() -> Result<()> {let u64_to_f64 = instance.get_typed_func::<(u64,), (f64,)>(&mut store, "u64-to-f64")?;assert_eq!(f32_to_u32.call(&mut store, (1.0,))?, (1.0f32.to_bits(),));- f32_to_u32.post_return(&mut store)?;assert_eq!(f64_to_u64.call(&mut store, (2.0,))?, (2.0f64.to_bits(),));- f64_to_u64.post_return(&mut store)?;assert_eq!(u32_to_f32.call(&mut store, (3.0f32.to_bits(),))?, (3.0,));- u32_to_f32.post_return(&mut store)?;assert_eq!(u64_to_f64.call(&mut store, (4.0f64.to_bits(),))?, (4.0,));- u64_to_f64.post_return(&mut store)?;assert_eq!(u32_to_f32@@ -514,7 +510,6 @@ fn floats() -> Result<()> {.to_bits(),CANON_32BIT_NAN | 1);- u32_to_f32.post_return(&mut store)?;assert_eq!(u64_to_f64.call(&mut store, (CANON_64BIT_NAN | 1,))?@@ -522,18 +517,15 @@ fn floats() -> Result<()> {.to_bits(),CANON_64BIT_NAN | 1,);- u64_to_f64.post_return(&mut store)?;assert_eq!(f32_to_u32.call(&mut store, (f32::from_bits(CANON_32BIT_NAN | 1),))?,(CANON_32BIT_NAN | 1,));- f32_to_u32.post_return(&mut store)?;assert_eq!(f64_to_u64.call(&mut store, (f64::from_bits(CANON_64BIT_NAN | 1),))?,(CANON_64BIT_NAN | 1,));- f64_to_u64.post_return(&mut store)?;Ok(())}@@ -564,15 +556,10 @@ fn bools() -> Result<()> {let bool_to_u32 = instance.get_typed_func::<(bool,), (u32,)>(&mut store, "bool-to-u32")?;assert_eq!(bool_to_u32.call(&mut store, (false,))?, (0,));- bool_to_u32.post_return(&mut store)?;assert_eq!(bool_to_u32.call(&mut store, (true,))?, (1,));- bool_to_u32.post_return(&mut store)?;assert_eq!(u32_to_bool.call(&mut store, (0,))?, (false,));- u32_to_bool.post_return(&mut store)?;assert_eq!(u32_to_bool.call(&mut store, (1,))?, (true,));- u32_to_bool.post_return(&mut store)?;assert_eq!(u32_to_bool.call(&mut store, (2,))?, (true,));- u32_to_bool.post_return(&mut store)?;Ok(())}@@ -604,9 +591,7 @@ fn chars() -> Result<()> {let mut roundtrip = |x: char| -> Result<()> {assert_eq!(char_to_u32.call(&mut store, (x,))?, (x as u32,));- char_to_u32.post_return(&mut store)?;assert_eq!(u32_to_char.call(&mut store, (x as u32,))?, (x,));- u32_to_char.post_return(&mut store)?;Ok(())};@@ -682,7 +667,7 @@ fn tuple_result() -> Result<()> {let input = (-1, 100, 3.0, 100.0);let output = instance.get_typed_func::<(i8, u16, f32, f64), ((i8, u16, f32, f64),)>(&mut store, "tuple")?- .call_and_post_return(&mut store, input)?;+ .call(&mut store, input)?;assert_eq!((input,), output);let invalid_func =@@ -773,23 +758,19 @@ fn strings() -> Result<()> {let mut roundtrip = |x: &str| -> Result<()> {let ret = list8_to_str.call(&mut store, (x.as_bytes(),))?.0;assert_eq!(ret.to_str(&store)?, x);- list8_to_str.post_return(&mut store)?;let utf16 = x.encode_utf16().collect::<Vec<_>>();let ret = list16_to_str.call(&mut store, (&utf16[..],))?.0;assert_eq!(ret.to_str(&store)?, x);- list16_to_str.post_return(&mut store)?;let ret = str_to_list8.call(&mut store, (x,))?.0;assert_eq!(ret.iter(&mut store).collect::<Result<Vec<_>>>()?,x.as_bytes());- str_to_list8.post_return(&mut store)?;let ret = str_to_list16.call(&mut store, (x,))?.0;assert_eq!(ret.iter(&mut store).collect::<Result<Vec<_>>>()?, utf16,);- str_to_list16.post_return(&mut store)?;Ok(())};@@ -803,29 +784,24 @@ fn strings() -> Result<()> {let ret = list8_to_str.call(&mut store, (b"\xff",))?.0;let err = ret.to_str(&store).unwrap_err();assert!(err.to_string().contains("invalid utf-8"), "{}", err);- list8_to_str.post_return(&mut store)?;let ret = list8_to_str.call(&mut store, (b"hello there \xff invalid",))?.0;let err = ret.to_str(&store).unwrap_err();assert!(err.to_string().contains("invalid utf-8"), "{}", err);- list8_to_str.post_return(&mut store)?;let ret = list16_to_str.call(&mut store, (&[0xd800],))?.0;let err = ret.to_str(&store).unwrap_err();assert!(err.to_string().contains("unpaired surrogate"), "{}", err);- list16_to_str.post_return(&mut store)?;let ret = list16_to_str.call(&mut store, (&[0xdfff],))?.0;let err = ret.to_str(&store).unwrap_err();assert!(err.to_string().contains("unpaired surrogate"), "{}", err);- list16_to_str.post_return(&mut store)?;let ret = list16_to_str.call(&mut store, (&[0xd800, 0xff00],))?.0;let err = ret.to_str(&store).unwrap_err();assert!(err.to_string().contains("unpaired surrogate"), "{}", err);- list16_to_str.post_return(&mut store)?;Ok(())}@@ -2096,12 +2072,12 @@ fn some_traps() -> Result<()> {with_new_instance(&engine, &component, |store, instance| {instance.get_typed_func::<(&[u8],), ()>(&mut *store, "take-list-end-oob")?- .call_and_post_return(store, (&[],))+ .call(store, (&[],))})?;with_new_instance(&engine, &component, |store, instance| {instance.get_typed_func::<(&[u8],), ()>(&mut *store, "take-list-end-oob")?- .call_and_post_return(store, (&[1, 2, 3, 4],))+ .call(store, (&[1, 2, 3, 4],))})?;let err = with_new_instance(&engine, &component, |store, instance| {instance@@ -2113,12 +2089,12 @@ fn some_traps() -> Result<()> {with_new_instance(&engine, &component, |store, instance| {instance.get_typed_func::<(&str,), ()>(&mut *store, "take-string-end-oob")?- .call_and_post_return(store, ("",))+ .call(store, ("",))})?;with_new_instance(&engine, &component, |store, instance| {instance.get_typed_func::<(&str,), ()>(&mut *store, "take-string-end-oob")?- .call_and_post_return(store, ("abcd",))+ .call(store, ("abcd",))})?;let err = with_new_instance(&engine, &component, |store, instance| {instance@@ -2214,15 +2190,12 @@ fn char_bool_memory() -> Result<()> {let (ret,) = func.call(&mut store, (0, 'a' as u32))?;assert_eq!(ret, (false, 'a'));- func.post_return(&mut store)?;let (ret,) = func.call(&mut store, (1, '🍰' as u32))?;assert_eq!(ret, (true, '🍰'));- func.post_return(&mut store)?;let (ret,) = func.call(&mut store, (2, 'a' as u32))?;assert_eq!(ret, (true, 'a'));- func.post_return(&mut store)?;assert!(func.call(&mut store, (0, 0xd800)).is_err());@@ -2434,26 +2407,20 @@ fn option() -> Result<()> {let option_u8_to_tuple = instance.get_typed_func::<(Option<u8>,), ((u32, u32),)>(&mut store, "option-u8-to-tuple")?;assert_eq!(option_u8_to_tuple.call(&mut store, (None,))?, ((0, 0),));- option_u8_to_tuple.post_return(&mut store)?;assert_eq!(option_u8_to_tuple.call(&mut store, (Some(0),))?, ((1, 0),));- option_u8_to_tuple.post_return(&mut store)?;assert_eq!(option_u8_to_tuple.call(&mut store, (Some(100),))?,((1, 100),));- option_u8_to_tuple.post_return(&mut store)?;let option_u32_to_tuple = instance.get_typed_func::<(Option<u32>,), ((u32, u32),)>(&mut store, "option-u32-to-tuple")?;assert_eq!(option_u32_to_tuple.call(&mut store, (None,))?, ((0, 0),));- option_u32_to_tuple.post_return(&mut store)?;assert_eq!(option_u32_to_tuple.call(&mut store, (Some(0),))?, ((1, 0),));- option_u32_to_tuple.post_return(&mut store)?;assert_eq!(option_u32_to_tuple.call(&mut store, (Some(100),))?,((1, 100),));- option_u32_to_tuple.post_return(&mut store)?;let option_string_to_tuple = instance.get_typed_func::<(Option<&str>,), ((u32, WasmStr),)>(&mut store,@@ -2462,39 +2429,30 @@ fn option() -> Result<()> {let ((a, b),) = option_string_to_tuple.call(&mut store, (None,))?;assert_eq!(a, 0);assert_eq!(b.to_str(&store)?, "");- option_string_to_tuple.post_return(&mut store)?;let ((a, b),) = option_string_to_tuple.call(&mut store, (Some(""),))?;assert_eq!(a, 1);assert_eq!(b.to_str(&store)?, "");- option_string_to_tuple.post_return(&mut store)?;let ((a, b),) = option_string_to_tuple.call(&mut store, (Some("hello"),))?;assert_eq!(a, 1);assert_eq!(b.to_str(&store)?, "hello");- option_string_to_tuple.post_return(&mut store)?;let instance = linker.instantiate(&mut store, &component)?;let to_option_u8 =instance.get_typed_func::<(u32, u32), (Option<u8>,)>(&mut store, "to-option-u8")?;assert_eq!(to_option_u8.call(&mut store, (0x00_00, 0))?, (None,));- to_option_u8.post_return(&mut store)?;assert_eq!(to_option_u8.call(&mut store, (0x00_01, 0))?, (Some(0),));- to_option_u8.post_return(&mut store)?;assert_eq!(to_option_u8.call(&mut store, (0xfd_01, 0))?, (Some(0xfd),));- to_option_u8.post_return(&mut store)?;assert!(to_option_u8.call(&mut store, (0x00_02, 0)).is_err());let instance = linker.instantiate(&mut store, &component)?;let to_option_u32 =instance.get_typed_func::<(u32, u32), (Option<u32>,)>(&mut store, "to-option-u32")?;assert_eq!(to_option_u32.call(&mut store, (0, 0))?, (None,));- to_option_u32.post_return(&mut store)?;assert_eq!(to_option_u32.call(&mut store, (1, 0))?, (Some(0),));- to_option_u32.post_return(&mut store)?;assert_eq!(to_option_u32.call(&mut store, (1, 0x1234fead))?,(Some(0x1234fead),));- to_option_u32.post_return(&mut store)?;assert!(to_option_u32.call(&mut store, (2, 0)).is_err());let instance = linker.instantiate(&mut store, &component)?;@@ -2502,13 +2460,10 @@ fn option() -> Result<()> {.get_typed_func::<(u32, &str), (Option<WasmStr>,)>(&mut store, "to-option-string")?;let ret = to_option_string.call(&mut store, (0, ""))?.0;assert!(ret.is_none());- to_option_string.post_return(&mut store)?;let ret = to_option_string.call(&mut store, (1, ""))?.0;assert_eq!(ret.unwrap().to_str(&store)?, "");- to_option_string.post_return(&mut store)?;let ret = to_option_string.call(&mut store, (1, "cheesecake"))?.0;assert_eq!(ret.unwrap().to_str(&store)?, "cheesecake");- to_option_string.post_return(&mut store)?;assert!(to_option_string.call(&mut store, (2, "")).is_err());Ok(())@@ -2602,19 +2557,15 @@ fn expected() -> Result<()> {let take_expected_unit =instance.get_typed_func::<(Result<(), ()>,), (u32,)>(&mut store, "take-expected-unit")?;assert_eq!(take_expected_unit.call(&mut store, (Ok(()),))?, (0,));- take_expected_unit.post_return(&mut store)?;assert_eq!(take_expected_unit.call(&mut store, (Err(()),))?, (1,));- take_expected_unit.post_return(&mut store)?;let take_expected_u8_f32 = instance.get_typed_func::<(Result<u8, f32>,), ((u32, u32),)>(&mut store, "take-expected-u8-f32")?;assert_eq!(take_expected_u8_f32.call(&mut store, (Ok(1),))?, ((0, 1),));- take_expected_u8_f32.post_return(&mut store)?;assert_eq!(take_expected_u8_f32.call(&mut store, (Err(2.0),))?,((1, 2.0f32.to_bits()),));- take_expected_u8_f32.post_return(&mut store)?;let take_expected_string = instance.get_typed_func::<(Result<&str, &[u8]>,), ((u32, WasmStr),)>(@@ -2624,19 +2575,15 @@ fn expected() -> Result<()> {let ((a, b),) = take_expected_string.call(&mut store, (Ok("hello"),))?;assert_eq!(a, 0);assert_eq!(b.to_str(&store)?, "hello");- take_expected_string.post_return(&mut store)?;let ((a, b),) = take_expected_string.call(&mut store, (Err(b"goodbye"),))?;assert_eq!(a, 1);assert_eq!(b.to_str(&store)?, "goodbye");- take_expected_string.post_return(&mut store)?;let instance = linker.instantiate(&mut store, &component)?;let to_expected_unit =instance.get_typed_func::<(u32,), (Result<(), ()>,)>(&mut store, "to-expected-unit")?;assert_eq!(to_expected_unit.call(&mut store, (0,))?, (Ok(()),));- to_expected_unit.post_return(&mut store)?;assert_eq!(to_expected_unit.call(&mut store, (1,))?, (Err(()),));- to_expected_unit.post_return(&mut store)?;let err = to_expected_unit.call(&mut store, (2,)).unwrap_err();assert!(err.to_string().contains("invalid expected"), "{}", err);@@ -2644,19 +2591,15 @@ fn expected() -> Result<()> {let to_expected_s16_f32 = instance.get_typed_func::<(u32, u32), (Result<i16, f32>,)>(&mut store, "to-expected-s16-f32")?;assert_eq!(to_expected_s16_f32.call(&mut store, (0, 0))?, (Ok(0),));- to_expected_s16_f32.post_return(&mut store)?;assert_eq!(to_expected_s16_f32.call(&mut store, (0, 100))?, (Ok(100),));- to_expected_s16_f32.post_return(&mut store)?;assert_eq!(to_expected_s16_f32.call(&mut store, (1, 1.0f32.to_bits()))?,(Err(1.0),));- to_expected_s16_f32.post_return(&mut store)?;let ret = to_expected_s16_f32.call(&mut store, (1, CANON_32BIT_NAN | 1))?.0;assert_eq!(ret.unwrap_err().to_bits(), CANON_32BIT_NAN | 1);- to_expected_s16_f32.post_return(&mut store)?;assert!(to_expected_s16_f32.call(&mut store, (2, 0)).is_err());Ok(())@@ -3008,7 +2951,7 @@ fn raw_slice_of_various_types() -> Result<()> {let list = instance.get_typed_func::<(), (WasmList<u8>,)>(&mut store, "list-u8")?- .call_and_post_return(&mut store, ())?+ .call(&mut store, ())?.0;assert_eq!(list.as_le_slice(&store),@@ -3019,7 +2962,7 @@ fn raw_slice_of_various_types() -> Result<()> {);let list = instance.get_typed_func::<(), (WasmList<i8>,)>(&mut store, "list-i8")?- .call_and_post_return(&mut store, ())?+ .call(&mut store, ())?.0;assert_eq!(list.as_le_slice(&store),@@ -3031,7 +2974,7 @@ fn raw_slice_of_various_types() -> Result<()> {let list = instance.get_typed_func::<(), (WasmList<u16>,)>(&mut store, "list-u16")?- .call_and_post_return(&mut store, ())?+ .call(&mut store, ())?.0;assert_eq!(list.as_le_slice(&store),@@ -3048,7 +2991,7 @@ fn raw_slice_of_various_types() -> Result<()> {);let list = instance.get_typed_func::<(), (WasmList<i16>,)>(&mut store, "list-i16")?- .call_and_post_return(&mut store, ())?+ .call(&mut store, ())?.0;assert_eq!(list.as_le_slice(&store),@@ -3065,7 +3008,7 @@ fn raw_slice_of_various_types() -> Result<()> {);let list = instance.get_typed_func::<(), (WasmList<u32>,)>(&mut store, "list-u32")?- .call_and_post_return(&mut store, ())?+ .call(&mut store, ())?.0;assert_eq!(list.as_le_slice(&store),@@ -3078,7 +3021,7 @@ fn raw_slice_of_various_types() -> Result<()> {);let list = instance.get_typed_func::<(), (WasmList<i32>,)>(&mut store, "list-i32")?- .call_and_post_return(&mut store, ())?+ .call(&mut store, ())?.0;assert_eq!(list.as_le_slice(&store),@@ -3091,7 +3034,7 @@ fn raw_slice_of_various_types() -> Result<()> {);let list = instance.get_typed_func::<(), (WasmList<u64>,)>(&mut store, "list-u64")?- .call_and_post_return(&mut store, ())?+ .call(&mut store, ())?.0;assert_eq!(list.as_le_slice(&store),@@ -3102,7 +3045,7 @@ fn raw_slice_of_various_types() -> Result<()> {);let list = instance.get_typed_func::<(), (WasmList<i64>,)>(&mut store, "list-i64")?- .call_and_post_return(&mut store, ())?+ .call(&mut store, ())?.0;assert_eq!(list.as_le_slice(&store),@@ -3460,8 +3403,17 @@ fn test_recurse(kind: RecurseKind) -> Result<()> {Ok(())}-#[test]-fn thread_index_during_init() -> Result<()> {+#[tokio::test]+async fn thread_index_via_instantiation_sync() -> Result<()> {+ thread_index_via_instantiation(ApiStyle::Sync).await+}++#[tokio::test]+async fn thread_index_via_instantiation_async() -> Result<()> {+ thread_index_via_instantiation(ApiStyle::Async).await+}++async fn thread_index_via_instantiation(style: ApiStyle) -> Result<()> {let component = r#"(component(core module $m@@ -3477,18 +3429,30 @@ fn thread_index_during_init() -> Result<()> {)))))"#;- let mut config = super::config();- config.wasm_component_model_threading(true);- let engine = Engine::new(&config)?;+ let engine = Engine::new(&style.config())?;let component = Component::new(&engine, component)?;let mut store = Store::new(&engine, ());let linker = Linker::new(&engine);- linker.instantiate(&mut store, &component)?;+ style.instantiate(&mut store, &linker, &component).await?;Ok(())}-#[test]-fn thread_index_via_sync_host_call() -> Result<()> {+#[tokio::test]+async fn thread_index_via_call_sync() -> Result<()> {+ thread_index_via_call(ApiStyle::Sync).await+}++#[tokio::test]+async fn thread_index_via_call_async() -> Result<()> {+ thread_index_via_call(ApiStyle::Async).await+}++#[tokio::test]+async fn thread_index_via_call_concurrent() -> Result<()> {+ thread_index_via_call(ApiStyle::Concurrent).await+}++async fn thread_index_via_call(style: ApiStyle) -> Result<()> {let component = r#"(component(core module $m@@ -3504,20 +3468,32 @@ fn thread_index_via_sync_host_call() -> Result<()> {(func (export "run") (canon lift (core func $m "run"))))"#;- let mut config = super::config();- config.wasm_component_model_threading(true);- let engine = Engine::new(&config)?;+ let engine = Engine::new(&style.config())?;let component = Component::new(&engine, component)?;let mut store = Store::new(&engine, ());let linker = Linker::new(&engine);- let instance = linker.instantiate(&mut store, &component)?;+ let instance = style.instantiate(&mut store, &linker, &component).await?;let run = instance.get_typed_func::<(), ()>(&mut store, "run")?;- run.call_and_post_return(&mut store, ())?;+ style.call(&mut store, run, ()).await?;Ok(())}-#[test]-fn thread_index_via_sync_host_call_post_return() -> Result<()> {+#[tokio::test]+async fn thread_index_via_post_return_sync() -> Result<()> {+ thread_index_via_post_return(ApiStyle::Sync).await+}++#[tokio::test]+async fn thread_index_via_post_return_async() -> Result<()> {+ thread_index_via_post_return(ApiStyle::Async).await+}++#[tokio::test]+async fn thread_index_via_post_return_concurrent() -> Result<()> {+ thread_index_via_post_return(ApiStyle::Concurrent).await+}++async fn thread_index_via_post_return(style: ApiStyle) -> Result<()> {let component = r#"(component(core module $m@@ -3541,20 +3517,32 @@ fn thread_index_via_sync_host_call_post_return() -> Result<()> {(func (export "run") (canon lift (core func $m "run") (post-return (func $m "run-post-return")))))"#;- let mut config = super::config();- config.wasm_component_model_threading(true);- let engine = Engine::new(&config)?;+ let engine = Engine::new(&style.config())?;let component = Component::new(&engine, component)?;let mut store = Store::new(&engine, ());let linker = Linker::new(&engine);- let instance = linker.instantiate(&mut store, &component)?;+ let instance = style.instantiate(&mut store, &linker, &component).await?;let run = instance.get_typed_func::<(), ()>(&mut store, "run")?;- run.call_and_post_return(&mut store, ())?;+ style.call(&mut store, run, ()).await?;Ok(())}-#[test]-fn thread_index_via_sync_host_call_cabi_realloc() -> Result<()> {+#[tokio::test]+async fn thread_index_via_cabi_realloc_sync() -> Result<()> {+ thread_index_via_cabi_realloc(ApiStyle::Sync).await+}++#[tokio::test]+async fn thread_index_via_cabi_realloc_async() -> Result<()> {+ thread_index_via_cabi_realloc(ApiStyle::Async).await+}++#[tokio::test]+async fn thread_index_via_cabi_realloc_concurrent() -> Result<()> {+ thread_index_via_cabi_realloc(ApiStyle::Concurrent).await+}++async fn thread_index_via_cabi_realloc(style: ApiStyle) -> Result<()> {let component = r#"(component(core module $m@@ -3584,20 +3572,32 @@ fn thread_index_via_sync_host_call_cabi_realloc() -> Result<()> {)))"#;- let mut config = super::config();- config.wasm_component_model_threading(true);- let engine = Engine::new(&config)?;+ let engine = Engine::new(&style.config())?;let component = Component::new(&engine, component)?;let mut store = Store::new(&engine, ());let linker = Linker::new(&engine);- let instance = linker.instantiate(&mut store, &component)?;- let run = instance.get_typed_func::<(&str,), ()>(&mut store, "run")?;- run.call_and_post_return(&mut store, ("hola",))?;+ let instance = style.instantiate(&mut store, &linker, &component).await?;+ let run = instance.get_typed_func::<(String,), ()>(&mut store, "run")?;+ style.call(&mut store, run, ("hola".to_string(),)).await?;Ok(())}-#[test]-fn thread_index_via_resource_drop_from_host() -> Result<()> {+#[tokio::test]+async fn thread_index_via_resource_drop_sync() -> Result<()> {+ thread_index_via_resource_drop(ApiStyle::Sync).await+}++#[tokio::test]+async fn thread_index_via_resource_drop_async() -> Result<()> {+ thread_index_via_resource_drop(ApiStyle::Async).await+}++#[tokio::test]+async fn thread_index_via_resource_drop_concurrent() -> Result<()> {+ thread_index_via_resource_drop(ApiStyle::Concurrent).await+}++async fn thread_index_via_resource_drop(style: ApiStyle) -> Result<()> {let component = r#"(component(core module $m@@ -3635,25 +3635,37 @@ fn thread_index_via_resource_drop_from_host() -> Result<()> {(export "i" (instance $c)))"#;- let mut config = super::config();- config.wasm_component_model_threading(true);- let engine = Engine::new(&config)?;+ let engine = Engine::new(&style.config())?;let component = Component::new(&engine, component)?;let mut store = Store::new(&engine, ());let linker = Linker::new(&engine);- let instance = linker.instantiate(&mut store, &component)?;+ let instance = style.instantiate(&mut store, &linker, &component).await?;let instance_index = instance.get_export_index(&mut store, None, "i").unwrap();let func_index = instance.get_export_index(&mut store, Some(&instance_index), "new").unwrap();let run = instance.get_typed_func::<(), (ResourceAny,)>(&mut store, &func_index)?;- let (resource,) = run.call_and_post_return(&mut store, ())?;- resource.resource_drop(&mut store)?;+ let (resource,) = style.call(&mut store, run, ()).await?;+ style.resource_drop(&mut store, resource).await?;Ok(())}-#[test]-fn thread_index_via_sync_host_call_and_sync_guest_call() -> Result<()> {+#[tokio::test]+async fn thread_index_via_guest_call_sync() -> Result<()> {+ thread_index_via_guest_call(ApiStyle::Sync).await+}++#[tokio::test]+async fn thread_index_via_guest_call_async() -> Result<()> {+ thread_index_via_guest_call(ApiStyle::Async).await+}++#[tokio::test]+async fn thread_index_via_guest_call_concurrent() -> Result<()> {+ thread_index_via_guest_call(ApiStyle::Concurrent).await+}++async fn thread_index_via_guest_call(style: ApiStyle) -> Result<()> {let component = r#"(component(component $c@@ -3699,15 +3711,13 @@ fn thread_index_via_sync_host_call_and_sync_guest_call() -> Result<()> {(func (export "run") (alias export $d "run")))"#;- let mut config = super::config();- config.wasm_component_model_threading(true);- let engine = Engine::new(&config)?;+ let engine = Engine::new(&style.config())?;let component = Component::new(&engine, component)?;let mut store = Store::new(&engine, ());let linker = Linker::new(&engine);- let instance = linker.instantiate(&mut store, &component)?;+ let instance = style.instantiate(&mut store, &linker, &component).await?;let run = instance.get_typed_func::<(), ()>(&mut store, "run")?;- run.call_and_post_return(&mut store, ())?;+ style.call(&mut store, run, ()).await?;Ok(())}diff --git a/tests/all/component_model/macros.rs b/tests/all/component_model/macros.rsindex c8d790c7ff..554a19aa65 100644--- a/tests/all/component_model/macros.rs+++ b/tests/all/component_model/macros.rs@@ -1,6 +1,6 @@#![cfg(not(miri))]-use super::{TypedFuncExt, make_echo_component};+use super::make_echo_component;use wasmtime::Result;use wasmtime::component::{Component, ComponentType, Lift, Linker, Lower};use wasmtime::{Engine, Store};@@ -30,7 +30,7 @@ fn record_derive() -> Result<()> {let input = Foo { a: -42, b: 73 };let output = instance.get_typed_func::<(Foo,), (Foo,)>(&mut store, "echo")?- .call_and_post_return(&mut store, (input,))?;+ .call(&mut store, (input,))?;assert_eq!((input,), output);@@ -116,7 +116,7 @@ fn record_derive() -> Result<()> {let output = instance.get_typed_func::<(Generic<i32, u32>,), (Generic<i32, u32>,)>(&mut store, "echo")?- .call_and_post_return(&mut store, (input,))?;+ .call(&mut store, (input,))?;assert_eq!((input,), output);@@ -150,7 +150,7 @@ fn variant_derive() -> Result<()> {let func = instance.get_typed_func::<(Foo,), (Foo,)>(&mut store, "echo")?;for &input in &[Foo::A(-42), Foo::B(73), Foo::C] {- let output = func.call_and_post_return(&mut store, (input,))?;+ let output = func.call(&mut store, (input,))?;assert_eq!((input,), output);}@@ -240,7 +240,7 @@ fn variant_derive() -> Result<()> {.get_typed_func::<(Generic<i32, u32>,), (Generic<i32, u32>,)>(&mut store, "echo")?;for &input in &[Generic::<i32, u32>::A(-42), Generic::B(73), Generic::C] {- let output = func.call_and_post_return(&mut store, (input,))?;+ let output = func.call(&mut store, (input,))?;assert_eq!((input,), output);}@@ -273,7 +273,7 @@ fn enum_derive() -> Result<()> {let func = instance.get_typed_func::<(Foo,), (Foo,)>(&mut store, "echo")?;for &input in &[Foo::A, Foo::B, Foo::C] {- let output = func.call_and_post_return(&mut store, (input,))?;+ let output = func.call(&mut store, (input,))?;assert_eq!((input,), output);}@@ -342,7 +342,7 @@ fn enum_derive() -> Result<()> {let func = instance.get_typed_func::<(Many,), (Many,)>(&mut store, "echo")?;for &input in &[Many::V0, Many::V1, Many::V254, Many::V255, Many::V256] {- let output = func.call_and_post_return(&mut store, (input,))?;+ let output = func.call(&mut store, (input,))?;assert_eq!((input,), output);}@@ -404,7 +404,7 @@ fn flags() -> Result<()> {input |= Foo::C;}- let output = func.call_and_post_return(&mut store, (input,))?;+ let output = func.call(&mut store, (input,))?;assert_eq!((input,), output);}@@ -500,7 +500,7 @@ fn flags() -> Result<()> {Foo8Exact::F6,Foo8Exact::F7,] {- let output = func.call_and_post_return(&mut store, (input,))?;+ let output = func.call(&mut store, (input,))?;assert_eq!((input,), output);}@@ -543,7 +543,7 @@ fn flags() -> Result<()> {let func = instance.get_typed_func::<(Foo16,), (Foo16,)>(&mut store, "echo")?;for &input in &[Foo16::F0, Foo16::F1, Foo16::F6, Foo16::F7, Foo16::F8] {- let output = func.call_and_post_return(&mut store, (input,))?;+ let output = func.call(&mut store, (input,))?;assert_eq!((input,), output);}@@ -597,7 +597,7 @@ fn flags() -> Result<()> {Foo16Exact::F14,Foo16Exact::F15,] {- let output = func.call_and_post_return(&mut store, (input,))?;+ let output = func.call(&mut store, (input,))?;assert_eq!((input,), output);}@@ -630,7 +630,7 @@ fn flags() -> Result<()> {let func = instance.get_typed_func::<(Foo32,), (Foo32,)>(&mut store, "echo")?;for &input in &[Foo32::F0, Foo32::F1, Foo32::F14, Foo32::F15, Foo32::F16] {- let output = func.call_and_post_return(&mut store, (input,))?;+ let output = func.call(&mut store, (input,))?;assert_eq!((input,), output);}@@ -684,7 +684,7 @@ fn flags() -> Result<()> {Foo32Exact::F30,Foo32Exact::F31,] {- let output = func.call_and_post_return(&mut store, (input,))?;+ let output = func.call(&mut store, (input,))?;assert_eq!((input,), output);}diff --git a/tests/all/component_model/missing_async.rs b/tests/all/component_model/missing_async.rsindex 56851aa4cb..ec4fdc935a 100644--- a/tests/all/component_model/missing_async.rs+++ b/tests/all/component_model/missing_async.rs@@ -44,17 +44,6 @@ async fn async_disallows_func_call() -> Result<()> {Ok(())}-#[tokio::test]-async fn async_disallows_func_post_return() -> Result<()> {- let mut store = async_store();- let func = func_in_store(&mut store).await?;- func.call_async(&mut store, &[], &mut []).await?;-- assert!(func.post_return(&mut store).is_err());- func.post_return_async(&mut store).await?;- Ok(())-}-#[tokio::test]async fn async_disallows_typed_func_call() -> Result<()> {let mut store = async_store();@@ -65,17 +54,6 @@ async fn async_disallows_typed_func_call() -> Result<()> {Ok(())}-#[tokio::test]-async fn async_disallows_typed_func_post_return() -> Result<()> {- let mut store = async_store();- let func = func_in_store(&mut store).await?;- let func = func.typed::<(), ()>(&store)?;- func.call_async(&mut store, ()).await?;- assert!(func.post_return(&mut store).is_err());- func.post_return_async(&mut store).await?;- Ok(())-}-#[tokio::test]async fn async_disallows_instantiate() -> Result<()> {let mut store = async_store();@@ -200,7 +178,6 @@ async fn async_disallows_resource_any_drop() -> Result<()> {.await?;let func = instance.get_typed_func::<(u32,), (ResourceAny,)>(&mut store, "mk")?;let (resource,) = func.call_async(&mut store, (42,)).await?;- func.post_return_async(&mut store).await?;assert!(resource.resource_drop(&mut store).is_err());resource.resource_drop_async(&mut store).await?;diff --git a/tests/all/component_model/post_return.rs b/tests/all/component_model/post_return.rsindex 9ae1d30a63..39ba3111b4 100644--- a/tests/all/component_model/post_return.rs+++ b/tests/all/component_model/post_return.rs@@ -1,91 +1,36 @@#![cfg(not(miri))]-use wasmtime::Result;+use super::ApiStyle;use wasmtime::component::*;+use wasmtime::{Engine, Result};use wasmtime::{Store, StoreContextMut, Trap};-#[test]-fn invalid_api() -> Result<()> {- let component = r#"- (component- (core module $m- (func (export "thunk1"))- (func (export "thunk2"))- )- (core instance $i (instantiate $m))- (func (export "thunk1")- (canon lift (core func $i "thunk1"))- )- (func (export "thunk2")- (canon lift (core func $i "thunk2"))- )- )- "#;-- let engine = super::engine();- let component = Component::new(&engine, component)?;- let mut store = Store::new(&engine, ());- let instance = Linker::new(&engine).instantiate(&mut store, &component)?;- let thunk1 = instance.get_typed_func::<(), ()>(&mut store, "thunk1")?;- let thunk2 = instance.get_typed_func::<(), ()>(&mut store, "thunk2")?;-- // Ensure that we can't call `post_return` before doing anything- let msg = "post_return can only be called after a function has previously been called";- assert_panics(|| drop(thunk1.post_return(&mut store)), msg);- assert_panics(|| drop(thunk2.post_return(&mut store)), msg);-- // Schedule a "needs post return"- thunk1.call(&mut store, ())?;-- // Ensure that we can't reenter the instance through either this function or- // another one.- let err = thunk1.call(&mut store, ()).unwrap_err();- assert_eq!(- err.downcast_ref(),- Some(&Trap::CannotEnterComponent),- "{err}",- );- let err = thunk2.call(&mut store, ()).unwrap_err();- assert_eq!(- err.downcast_ref(),- Some(&Trap::CannotEnterComponent),- "{err}",- );-- // Calling post-return on the wrong function should panic- assert_panics(- || drop(thunk2.post_return(&mut store)),- "calling post_return on wrong function",- );+#[tokio::test]+async fn invoke_post_return_sync() -> Result<()> {+ invoke_post_return(ApiStyle::Sync, true).await+}- // Actually execute the post-return- thunk1.post_return(&mut store)?;+#[tokio::test]+async fn invoke_post_return_async() -> Result<()> {+ invoke_post_return(ApiStyle::Async, true).await+}- // And now post-return should be invalid again.- assert_panics(|| drop(thunk1.post_return(&mut store)), msg);- assert_panics(|| drop(thunk2.post_return(&mut store)), msg);+#[tokio::test]+async fn invoke_post_return_async_not_concurrent() -> Result<()> {+ invoke_post_return(ApiStyle::AsyncNotConcurrent, true).await+}- Ok(())+#[tokio::test]+async fn invoke_post_return_async_not_concurrent_dynamic() -> Result<()> {+ invoke_post_return(ApiStyle::AsyncNotConcurrent, false).await}-#[track_caller]-fn assert_panics(f: impl FnOnce(), msg: &str) {- match std::panic::catch_unwind(std::panic::AssertUnwindSafe(f)) {- Ok(()) => panic!("expected closure to panic"),- Err(e) => match e.downcast::<String>() {- Ok(s) => {- assert!(s.contains(msg), "bad panic: {s}");- }- Err(e) => match e.downcast::<&'static str>() {- Ok(s) => assert!(s.contains(msg), "bad panic: {s}"),- Err(_) => panic!("bad panic"),- },- },- }+#[tokio::test]+async fn invoke_post_return_concurrent() -> Result<()> {+ invoke_post_return(ApiStyle::Concurrent, true).await}-#[test]-fn invoke_post_return() -> Result<()> {+async fn invoke_post_return(style: ApiStyle, typed: bool) -> Result<()> {let component = r#"(component(import "f" (func $f))@@ -116,7 +61,7 @@ fn invoke_post_return() -> Result<()> {)"#;- let engine = super::engine();+ let engine = Engine::new(&style.config())?;let component = Component::new(&engine, component)?;let mut store = Store::new(&engine, ());let mut linker = Linker::new(&engine);@@ -126,11 +71,15 @@ fn invoke_post_return() -> Result<()> {unreachable!()})?;- let instance = linker.instantiate(&mut store, &component)?;+ let instance = style.instantiate(&mut store, &linker, &component).await?;let thunk = instance.get_typed_func::<(), ()>(&mut store, "thunk")?;- thunk.call(&mut store, ())?;- let result = thunk.post_return(&mut store);+ let result = if typed {+ style.call(&mut store, thunk, ()).await+ } else {+ assert!(matches!(style, ApiStyle::AsyncNotConcurrent));+ thunk.func().call_async(&mut store, &[], &mut []).await+ };assert!(matches!(result.unwrap_err().downcast::<Trap>(),Ok(Trap::CannotLeaveComponent)@@ -200,16 +149,12 @@ fn post_return_all_types() -> Result<()> {let f64 = instance.get_typed_func::<(), (f64,)>(&mut store, "f64")?;assert_eq!(i32.call(&mut store, ())?, (1,));- i32.post_return(&mut store)?;assert_eq!(i64.call(&mut store, ())?, (2,));- i64.post_return(&mut store)?;assert_eq!(f32.call(&mut store, ())?, (3.,));- f32.post_return(&mut store)?;assert_eq!(f64.call(&mut store, ())?, (4.,));- f64.post_return(&mut store)?;Ok(())}@@ -252,7 +197,6 @@ fn post_return_string() -> Result<()> {let get = instance.get_typed_func::<(), (WasmStr,)>(&mut store, "get")?;let s = get.call(&mut store, ())?.0;assert_eq!(s.to_str(&store)?, "hello world");- get.post_return(&mut store)?;Ok(())}@@ -280,8 +224,7 @@ fn trap_in_post_return_poisons_instance() -> Result<()> {let mut store = Store::new(&engine, ());let instance = Linker::new(&engine).instantiate(&mut store, &component)?;let f = instance.get_typed_func::<(), ()>(&mut store, "f")?;- f.call(&mut store, ())?;- let trap = f.post_return(&mut store).unwrap_err().downcast::<Trap>()?;+ let trap = f.call(&mut store, ()).unwrap_err().downcast::<Trap>()?;assert_eq!(trap, Trap::UnreachableCodeReached);let err = f.call(&mut store, ()).unwrap_err();assert_eq!(@@ -289,10 +232,6 @@ fn trap_in_post_return_poisons_instance() -> Result<()> {Some(&Trap::CannotEnterComponent),"{err}",);- assert_panics(- || drop(f.post_return(&mut store)),- "can only be called after",- );Ok(())}diff --git a/tests/all/component_model/resources.rs b/tests/all/component_model/resources.rsindex f40ab07f25..000ee2689c 100644--- a/tests/all/component_model/resources.rs+++ b/tests/all/component_model/resources.rs@@ -152,13 +152,9 @@ fn resource_any() -> Result<()> {let u_dtor = i.get_typed_func::<(ResourceAny,), ()>(&mut store, "drop-u")?;let (t1,) = t_ctor.call(&mut store, (100,))?;- t_ctor.post_return(&mut store)?;let (t2,) = t_ctor.call(&mut store, (200,))?;- t_ctor.post_return(&mut store)?;let (u1,) = u_ctor.call(&mut store, (300,))?;- u_ctor.post_return(&mut store)?;let (u2,) = u_ctor.call(&mut store, (400,))?;- u_ctor.post_return(&mut store)?;assert_eq!(t1.ty(), t);assert_eq!(t2.ty(), t);@@ -166,16 +162,12 @@ fn resource_any() -> Result<()> {assert_eq!(u2.ty(), u);u_dtor.call(&mut store, (u2,))?;- u_dtor.post_return(&mut store)?;u_dtor.call(&mut store, (u1,))?;- u_dtor.post_return(&mut store)?;t_dtor.call(&mut store, (t1,))?;- t_dtor.post_return(&mut store)?;t_dtor.call(&mut store, (t2,))?;- t_dtor.post_return(&mut store)?;}{@@ -187,13 +179,10 @@ fn resource_any() -> Result<()> {// `t` is placed at host index 0let (t,) = t_ctor.call(&mut store, (100,))?;- t_ctor.post_return(&mut store)?;t_dtor.call(&mut store, (t,))?;- t_dtor.post_return(&mut store)?;// `u` is also placed at host index 0 since `t` was deallocatedlet (_u,) = u_ctor.call(&mut store, (100,))?;- u_ctor.post_return(&mut store)?;// reuse of `t` should fail, despite it pointing to a valid resourceassert_eq!(@@ -270,7 +259,6 @@ fn mismatch_resource_types() -> Result<()> {let dtor = i.get_typed_func::<(ResourceAny,), ()>(&mut store, "dtor")?;let (t,) = ctor.call(&mut store, (100,))?;- ctor.post_return(&mut store)?;assert_eq!(dtor.call(&mut store, (t,)).unwrap_err().to_string(),"mismatched resource types"@@ -321,19 +309,13 @@ fn drop_in_different_places() -> Result<()> {let dtor3 = i.get_typed_func::<(ResourceAny,), ()>(&mut store, "dtor3")?;let (t,) = ctor.call(&mut store, (100,))?;- ctor.post_return(&mut store)?;dtor1.call(&mut store, (t,))?;- dtor1.post_return(&mut store)?;let (t,) = ctor.call(&mut store, (200,))?;- ctor.post_return(&mut store)?;dtor2.call(&mut store, (t,))?;- dtor2.post_return(&mut store)?;let (t,) = ctor.call(&mut store, (300,))?;- ctor.post_return(&mut store)?;dtor3.call(&mut store, (t,))?;- dtor3.post_return(&mut store)?;Ok(())}@@ -366,9 +348,7 @@ fn drop_guest_twice() -> Result<()> {let dtor = i.get_typed_func::<(&ResourceAny,), ()>(&mut store, "dtor")?;let (t,) = ctor.call(&mut store, (100,))?;- ctor.post_return(&mut store)?;dtor.call(&mut store, (&t,))?;- dtor.post_return(&mut store)?;assert_eq!(dtor.call(&mut store, (&t,)).unwrap_err().to_string(),@@ -406,7 +386,6 @@ fn drop_host_twice() -> Result<()> {let t = Resource::new_own(100);dtor.call(&mut store, (&t,))?;- dtor.post_return(&mut store)?;assert_eq!(dtor.call(&mut store, (&t,)).unwrap_err().to_string(),@@ -481,7 +460,6 @@ fn manually_destroy() -> Result<()> {// Host resources can be destroyed through `resource_drop`let t1 = Resource::new_own(100);let (t1,) = t1_pass.call(&mut store, (t1,))?;- t1_pass.post_return(&mut store)?;assert_eq!(store.data().drops, 0);assert_eq!(store.data().last_drop, None);t1.resource_drop(&mut store)?;@@ -490,16 +468,11 @@ fn manually_destroy() -> Result<()> {// Guest resources can be destroyed through `resource_drop`let (t2,) = t2_ctor.call(&mut store, (200,))?;- t2_ctor.post_return(&mut store)?;assert_eq!(t2_drops.call(&mut store, ())?, (0,));- t2_drops.post_return(&mut store)?;assert_eq!(t2_last_drop.call(&mut store, ())?, (0,));- t2_last_drop.post_return(&mut store)?;t2.resource_drop(&mut store)?;assert_eq!(t2_drops.call(&mut store, ())?, (1,));- t2_drops.post_return(&mut store)?;assert_eq!(t2_last_drop.call(&mut store, ())?, (200,));- t2_last_drop.post_return(&mut store)?;// Wires weren't crossed to drop more resourcesassert_eq!(store.data().drops, 1);@@ -604,12 +577,10 @@ fn dynamic_val() -> Result<()> {let t1 = Resource::new_own(100);let (t1,) = a_typed.call(&mut store, (t1,))?;- a_typed.post_return(&mut store)?;assert_eq!(t1.ty(), ResourceType::host::<MyType>());let mut results = [Val::Bool(false)];a.call(&mut store, &[Val::Resource(t1)], &mut results)?;- a.post_return(&mut store)?;match &results[0] {Val::Resource(resource) => {assert_eq!(resource.ty(), ResourceType::host::<MyType>());@@ -629,7 +600,6 @@ fn dynamic_val() -> Result<()> {let t1_any = Resource::<MyType>::new_own(100).try_into_resource_any(&mut store)?;let mut results = [Val::Bool(false)];a.call(&mut store, &[Val::Resource(t1_any)], &mut results)?;- a.post_return(&mut store)?;match &results[0] {Val::Resource(resource) => {assert_eq!(resource.ty(), ResourceType::host::<MyType>());@@ -650,7 +620,6 @@ fn dynamic_val() -> Result<()> {.try_into_resource_any(&mut store)?.try_into_resource(&mut store)?;let (t1,) = a_typed_result.call(&mut store, (t1,))?;- a_typed_result.post_return(&mut store)?;assert_eq!(t1.rep(), 100);assert!(t1.owned());@@ -660,7 +629,6 @@ fn dynamic_val() -> Result<()> {.try_into_resource_any(&mut store)?;let mut results = [Val::Bool(false)];a.call(&mut store, &[Val::Resource(t1_any)], &mut results)?;- a.post_return(&mut store)?;match &results[0] {Val::Resource(resource) => {assert_eq!(resource.ty(), ResourceType::host::<MyType>());@@ -740,7 +708,6 @@ fn cannot_reenter_during_import() -> Result<()> {let call = i.get_typed_func::<(), ()>(&mut store, "call")?;let (resource,) = ctor.call(&mut store, (100,))?;- ctor.post_return(&mut store)?;*store.data_mut() = Some(resource);call.call(&mut store, ())?;@@ -779,8 +746,7 @@ fn active_borrows_at_end_of_call() -> Result<()> {let f = i.get_typed_func::<(&Resource<MyType>,), ()>(&mut store, "f")?;let resource = Resource::new_own(1);- f.call(&mut store, (&resource,))?;- let err = f.post_return(&mut store).unwrap_err();+ let err = f.call(&mut store, (&resource,)).unwrap_err();assert_eq!(err.to_string(),"borrow handles still remain at the end of the call",@@ -844,7 +810,6 @@ fn thread_through_borrow() -> Result<()> {let resource = Resource::new_own(100);f.call(&mut store, (&resource,))?;- f.post_return(&mut store)?;Ok(())}@@ -931,22 +896,18 @@ fn can_use_own_for_borrow() -> Result<()> {let resource = Resource::new_own(100);f_typed.call(&mut store, (&resource,))?;- f_typed.post_return(&mut store)?;let resource = Resource::new_borrow(200);f_typed.call(&mut store, (&resource,))?;- f_typed.post_return(&mut store)?;let resource = Resource::<MyType>::new_own(300).try_into_resource_any(&mut store)?;f.call(&mut store, &[Val::Resource(resource)], &mut [])?;- f.post_return(&mut store)?;resource.resource_drop(&mut store)?;// TODO: Enable once https://github.com/bytecodealliance/wasmtime/issues/7793 is fixed//let resource =// Resource::<MyType>::new_borrow(400).try_into_resource_any(&mut store, &i_pre, ty_idx)?;//f.call(&mut store, &[Val::Resource(resource)], &mut [])?;- //f.post_return(&mut store)?;//resource.resource_drop(&mut store)?;Ok(())@@ -1124,7 +1085,6 @@ fn drop_no_dtor() -> Result<()> {let i = Linker::new(&engine).instantiate(&mut store, &c)?;let ctor = i.get_typed_func::<(u32,), (ResourceAny,)>(&mut store, "ctor")?;let (resource,) = ctor.call(&mut store, (100,))?;- ctor.post_return(&mut store)?;resource.resource_drop(&mut store)?;Ok(())@@ -1141,16 +1101,20 @@ fn host_borrow_as_resource_any() -> Result<()> {(import "f" (func $f (param "f" (borrow $t))))(core func $f (canon lower (func $f)))+ (core func $drop (canon resource.drop $t))(core module $m(import "" "f" (func $f (param i32)))+ (import "" "drop" (func $drop (param i32)))(func (export "f2") (param i32)(call $f (local.get 0))+ (call $drop (local.get 0))))(core instance $i (instantiate $m(with "" (instance(export "f" (func $f))+ (export "drop" (func $drop))))))@@ -1252,9 +1216,7 @@ fn pass_guest_back_as_borrow() -> Result<()> {let take = i.get_typed_func::<(&ResourceAny,), ()>(&mut store, "take")?;let (resource,) = mk.call(&mut store, ())?;- mk.post_return(&mut store)?;take.call(&mut store, (&resource,))?;- take.post_return(&mut store)?;resource.resource_drop(&mut store)?;@@ -1306,7 +1268,6 @@ fn pass_host_borrow_to_guest() -> Result<()> {let resource = Resource::new_borrow(100);take.call(&mut store, (&resource,))?;- take.post_return(&mut store)?;Ok(())}@@ -1466,7 +1427,6 @@ fn guest_different_host_same() -> Result<()> {let resource = Resource::new_own(100);f.call(&mut store, (&resource, &resource))?;- f.post_return(&mut store)?;Ok(())}@@ -1523,7 +1483,6 @@ fn resource_any_to_typed_handles_borrow() -> Result<()> {let resource = Resource::new_own(100);f.call(&mut store, (&resource,))?;- f.post_return(&mut store)?;Ok(())}@@ -1576,10 +1535,8 @@ fn resource_dynamic() -> Result<()> {let drop_u = instance.get_typed_func::<(ResourceDynamic,), ()>(&mut store, "drop-u")?;drop_t.call(&mut store, (ResourceDynamic::new_own(1, 2),))?;- drop_t.post_return(&mut store)?;drop_u.call(&mut store, (ResourceDynamic::new_own(2, 3),))?;- drop_u.post_return(&mut store)?;assert!(drop_t@@ -1666,7 +1623,6 @@ fn intrinsic_trampolines() -> Result<()> {let rep = i.get_typed_func::<(ResourceAny,), (u32,)>(&mut store, "rep")?;let r = new.call(&mut store, (42,))?.0;- new.post_return(&mut store)?;assert!(rep.call(&mut store, (r,)).is_err());Ok(())}diff --git a/tests/all/component_model/strings.rs b/tests/all/component_model/strings.rsindex ce60ea10fd..d341ef36a1 100644--- a/tests/all/component_model/strings.rs+++ b/tests/all/component_model/strings.rs@@ -188,7 +188,6 @@ fn test_roundtrip(engine: &Engine, src: &str, dst: &str) -> Result<()> {*store.data_mut() = string.to_string();let (ret,) = func.call(&mut store, (string.to_string(),))?;assert_eq!(ret, *string);- func.post_return(&mut store)?;}Ok(())}diff --git a/tests/all/pulley.rs b/tests/all/pulley.rsindex 50f4ffc533..bd651cb850 100644--- a/tests/all/pulley.rs+++ b/tests/all/pulley.rs@@ -272,43 +272,32 @@ fn pulley_provenance_test_components() -> Result<()> {instance.get_typed_func::<(&[&str],), (Vec<String>,)>(&mut store, "guest-list")?;guest_empty.call(&mut store, ())?;- guest_empty.post_return(&mut store)?;let (result,) = guest_u32.call(&mut store, (42,))?;assert_eq!(result, 42);- guest_u32.post_return(&mut store)?;let (result,) = guest_enum.call(&mut store, (E::B,))?;assert_eq!(result, E::B);- guest_enum.post_return(&mut store)?;let (result,) = guest_option.call(&mut store, (None,))?;assert_eq!(result, None);- guest_option.post_return(&mut store)?;let (result,) = guest_option.call(&mut store, (Some(200),))?;assert_eq!(result, Some(200));- guest_option.post_return(&mut store)?;let (result,) = guest_result.call(&mut store, (Ok(10),))?;assert_eq!(result, Ok(10));- guest_result.post_return(&mut store)?;let (result,) = guest_result.call(&mut store, (Err(i64::MIN),))?;assert_eq!(result, Err(i64::MIN));- guest_result.post_return(&mut store)?;let (result,) = guest_string.call(&mut store, ("",))?;assert_eq!(result, "");- guest_string.post_return(&mut store)?;let (result,) = guest_string.call(&mut store, ("hello",))?;assert_eq!(result, "hello");- guest_string.post_return(&mut store)?;let (result,) = guest_list.call(&mut store, (&[],))?;assert!(result.is_empty());- guest_list.post_return(&mut store)?;let (result,) = guest_list.call(&mut store, (&["a", "", "b", "c"],))?;assert_eq!(result, ["a", "", "b", "c"]);- guest_list.post_return(&mut store)?;instance.get_typed_func::<(), ()>(&mut store, "resource-intrinsics")?@@ -363,27 +352,22 @@ fn pulley_provenance_test_components() -> Result<()> {let mut results = [];guest_empty.call(&mut store, &[], &mut results)?;- guest_empty.post_return(&mut store)?;let mut results = [Val::U32(0)];guest_u32.call(&mut store, &[Val::U32(42)], &mut results)?;assert_eq!(results[0], Val::U32(42));- guest_u32.post_return(&mut store)?;guest_enum.call(&mut store, &[Val::Enum("B".into())], &mut results)?;assert_eq!(results[0], Val::Enum("B".into()));- guest_enum.post_return(&mut store)?;guest_option.call(&mut store, &[Val::Option(None)], &mut results)?;assert_eq!(results[0], Val::Option(None));- guest_option.post_return(&mut store)?;guest_option.call(&mut store,&[Val::Option(Some(Box::new(Val::U8(201))))],&mut results,)?;assert_eq!(results[0], Val::Option(Some(Box::new(Val::U8(201)))));- guest_option.post_return(&mut store)?;guest_result.call(&mut store,@@ -391,7 +375,6 @@ fn pulley_provenance_test_components() -> Result<()> {&mut results,)?;assert_eq!(results[0], Val::Result(Ok(Some(Box::new(Val::U16(20))))));- guest_result.post_return(&mut store)?;guest_result.call(&mut store,&[Val::Result(Err(Some(Box::new(Val::S64(i64::MAX)))))],@@ -401,18 +384,14 @@ fn pulley_provenance_test_components() -> Result<()> {results[0],Val::Result(Err(Some(Box::new(Val::S64(i64::MAX))))));- guest_result.post_return(&mut store)?;guest_string.call(&mut store, &[Val::String("B".into())], &mut results)?;assert_eq!(results[0], Val::String("B".into()));- guest_string.post_return(&mut store)?;guest_string.call(&mut store, &[Val::String("".into())], &mut results)?;assert_eq!(results[0], Val::String("".into()));- guest_string.post_return(&mut store)?;guest_list.call(&mut store, &[Val::List(Vec::new())], &mut results)?;assert_eq!(results[0], Val::List(Vec::new()));- guest_list.post_return(&mut store)?;}Ok(())