diff --git a/crates/component-macro/tests/expanded/char.rs b/crates/component-macro/tests/expanded/char.rs index 777df2d88fd6..b37c39c76d91 100644 --- a/crates/component-macro/tests/expanded/char.rs +++ b/crates/component-macro/tests/expanded/char.rs @@ -316,10 +316,7 @@ pub mod exports { &self, mut store: S, arg0: char, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (char,), @@ -334,10 +331,7 @@ pub mod exports { pub fn call_return_char( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), diff --git a/crates/component-macro/tests/expanded/conventions.rs b/crates/component-macro/tests/expanded/conventions.rs index 07aa1563d7b7..e03594312e4f 100644 --- a/crates/component-macro/tests/expanded/conventions.rs +++ b/crates/component-macro/tests/expanded/conventions.rs @@ -608,10 +608,7 @@ pub mod exports { pub fn call_kebab_case( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -626,10 +623,7 @@ pub mod exports { &self, mut store: S, arg0: LudicrousSpeed, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (LudicrousSpeed,), @@ -643,10 +637,7 @@ pub mod exports { pub fn call_function_with_dashes( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -659,10 +650,7 @@ pub mod exports { } pub fn call_function_with_no_weird_characters< S: wasmtime::AsContextMut, - >(&self, mut store: S) -> wasmtime::Result<()> - where - ::Data: Send, - { + >(&self, mut store: S) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -676,10 +664,7 @@ pub mod exports { pub fn call_apple( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -693,10 +678,7 @@ pub mod exports { pub fn call_apple_pear( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -710,10 +692,7 @@ pub mod exports { pub fn call_apple_pear_grape( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -727,10 +706,7 @@ pub mod exports { pub fn call_a0( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -749,10 +725,7 @@ pub mod exports { pub fn call_is_xml( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -766,10 +739,7 @@ pub mod exports { pub fn call_explicit( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -783,10 +753,7 @@ pub mod exports { pub fn call_explicit_kebab( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -801,10 +768,7 @@ pub mod exports { pub fn call_bool( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), diff --git a/crates/component-macro/tests/expanded/flags.rs b/crates/component-macro/tests/expanded/flags.rs index 1f9bffc7aecf..4b52e985b7d8 100644 --- a/crates/component-macro/tests/expanded/flags.rs +++ b/crates/component-macro/tests/expanded/flags.rs @@ -713,10 +713,7 @@ pub mod exports { &self, mut store: S, arg0: Flag1, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (Flag1,), @@ -731,10 +728,7 @@ pub mod exports { &self, mut store: S, arg0: Flag2, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (Flag2,), @@ -749,10 +743,7 @@ pub mod exports { &self, mut store: S, arg0: Flag4, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (Flag4,), @@ -767,10 +758,7 @@ pub mod exports { &self, mut store: S, arg0: Flag8, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (Flag8,), @@ -785,10 +773,7 @@ pub mod exports { &self, mut store: S, arg0: Flag16, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (Flag16,), @@ -803,10 +788,7 @@ pub mod exports { &self, mut store: S, arg0: Flag32, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (Flag32,), @@ -821,10 +803,7 @@ pub mod exports { &self, mut store: S, arg0: Flag64, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (Flag64,), diff --git a/crates/component-macro/tests/expanded/floats.rs b/crates/component-macro/tests/expanded/floats.rs index dcfd5a7d1d2e..187de8955049 100644 --- a/crates/component-macro/tests/expanded/floats.rs +++ b/crates/component-macro/tests/expanded/floats.rs @@ -350,10 +350,7 @@ pub mod exports { &self, mut store: S, arg0: f32, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (f32,), @@ -368,10 +365,7 @@ pub mod exports { &self, mut store: S, arg0: f64, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (f64,), @@ -385,10 +379,7 @@ pub mod exports { pub fn call_f32_result( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -402,10 +393,7 @@ pub mod exports { pub fn call_f64_result( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), diff --git a/crates/component-macro/tests/expanded/function-new.rs b/crates/component-macro/tests/expanded/function-new.rs index 235eab4b3ed5..1f24e5d7b908 100644 --- a/crates/component-macro/tests/expanded/function-new.rs +++ b/crates/component-macro/tests/expanded/function-new.rs @@ -161,10 +161,7 @@ const _: () = { pub fn call_new( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::<(), ()>::new_unchecked(self.new) }; diff --git a/crates/component-macro/tests/expanded/integers.rs b/crates/component-macro/tests/expanded/integers.rs index 1506a85003fa..2911be364803 100644 --- a/crates/component-macro/tests/expanded/integers.rs +++ b/crates/component-macro/tests/expanded/integers.rs @@ -678,10 +678,7 @@ pub mod exports { &self, mut store: S, arg0: u8, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (u8,), @@ -696,10 +693,7 @@ pub mod exports { &self, mut store: S, arg0: i8, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (i8,), @@ -714,10 +708,7 @@ pub mod exports { &self, mut store: S, arg0: u16, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (u16,), @@ -732,10 +723,7 @@ pub mod exports { &self, mut store: S, arg0: i16, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (i16,), @@ -750,10 +738,7 @@ pub mod exports { &self, mut store: S, arg0: u32, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (u32,), @@ -768,10 +753,7 @@ pub mod exports { &self, mut store: S, arg0: i32, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (i32,), @@ -786,10 +768,7 @@ pub mod exports { &self, mut store: S, arg0: u64, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (u64,), @@ -804,10 +783,7 @@ pub mod exports { &self, mut store: S, arg0: i64, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (i64,), @@ -829,10 +805,7 @@ pub mod exports { arg5: i32, arg6: u64, arg7: i64, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (u8, i8, u16, i16, u32, i32, u64, i64), @@ -850,10 +823,7 @@ pub mod exports { pub fn call_r1( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -867,10 +837,7 @@ pub mod exports { pub fn call_r2( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -884,10 +851,7 @@ pub mod exports { pub fn call_r3( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -901,10 +865,7 @@ pub mod exports { pub fn call_r4( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -918,10 +879,7 @@ pub mod exports { pub fn call_r5( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -935,10 +893,7 @@ pub mod exports { pub fn call_r6( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -952,10 +907,7 @@ pub mod exports { pub fn call_r7( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -969,10 +921,7 @@ pub mod exports { pub fn call_r8( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -986,10 +935,7 @@ pub mod exports { pub fn call_pair_ret( &self, mut store: S, - ) -> wasmtime::Result<(i64, u8)> - where - ::Data: Send, - { + ) -> wasmtime::Result<(i64, u8)> { let callee = unsafe { wasmtime::component::TypedFunc::< (), diff --git a/crates/component-macro/tests/expanded/lists.rs b/crates/component-macro/tests/expanded/lists.rs index f78b4bea4a2f..fbc3a284b623 100644 --- a/crates/component-macro/tests/expanded/lists.rs +++ b/crates/component-macro/tests/expanded/lists.rs @@ -1535,10 +1535,7 @@ pub mod exports { &self, mut store: S, arg0: &[u8], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[u8],), @@ -1553,10 +1550,7 @@ pub mod exports { &self, mut store: S, arg0: &[u16], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[u16],), @@ -1571,10 +1565,7 @@ pub mod exports { &self, mut store: S, arg0: &[u32], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[u32],), @@ -1589,10 +1580,7 @@ pub mod exports { &self, mut store: S, arg0: &[u64], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[u64],), @@ -1607,10 +1595,7 @@ pub mod exports { &self, mut store: S, arg0: &[i8], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[i8],), @@ -1625,10 +1610,7 @@ pub mod exports { &self, mut store: S, arg0: &[i16], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[i16],), @@ -1643,10 +1625,7 @@ pub mod exports { &self, mut store: S, arg0: &[i32], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[i32],), @@ -1661,10 +1640,7 @@ pub mod exports { &self, mut store: S, arg0: &[i64], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[i64],), @@ -1679,10 +1655,7 @@ pub mod exports { &self, mut store: S, arg0: &[f32], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[f32],), @@ -1697,10 +1670,7 @@ pub mod exports { &self, mut store: S, arg0: &[f64], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[f64],), @@ -1714,10 +1684,7 @@ pub mod exports { pub fn call_list_u8_ret( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1731,10 +1698,7 @@ pub mod exports { pub fn call_list_u16_ret( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1748,10 +1712,7 @@ pub mod exports { pub fn call_list_u32_ret( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1765,10 +1726,7 @@ pub mod exports { pub fn call_list_u64_ret( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1782,10 +1740,7 @@ pub mod exports { pub fn call_list_s8_ret( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1799,10 +1754,7 @@ pub mod exports { pub fn call_list_s16_ret( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1816,10 +1768,7 @@ pub mod exports { pub fn call_list_s32_ret( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1833,10 +1782,7 @@ pub mod exports { pub fn call_list_s64_ret( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1850,10 +1796,7 @@ pub mod exports { pub fn call_list_f32_ret( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1867,10 +1810,7 @@ pub mod exports { pub fn call_list_f64_ret( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1887,10 +1827,7 @@ pub mod exports { arg0: &[(u8, i8)], ) -> wasmtime::Result< wasmtime::component::__internal::Vec<(i64, u32)>, - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (&[(u8, i8)],), @@ -1905,10 +1842,7 @@ pub mod exports { &self, mut store: S, arg0: &[wasmtime::component::__internal::String], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[wasmtime::component::__internal::String],), @@ -1926,10 +1860,7 @@ pub mod exports { wasmtime::component::__internal::Vec< wasmtime::component::__internal::String, >, - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1952,10 +1883,7 @@ pub mod exports { wasmtime::component::__internal::Vec< (wasmtime::component::__internal::String, u8), >, - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (&[(u8, wasmtime::component::__internal::String)],), @@ -1978,10 +1906,7 @@ pub mod exports { wasmtime::component::__internal::Vec< wasmtime::component::__internal::String, >, - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (&[wasmtime::component::__internal::String],), @@ -2002,10 +1927,7 @@ pub mod exports { arg0: &[SomeRecord], ) -> wasmtime::Result< wasmtime::component::__internal::Vec, - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (&[SomeRecord],), @@ -2022,10 +1944,7 @@ pub mod exports { arg0: &[OtherRecord], ) -> wasmtime::Result< wasmtime::component::__internal::Vec, - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (&[OtherRecord],), @@ -2042,10 +1961,7 @@ pub mod exports { arg0: &[SomeVariant], ) -> wasmtime::Result< wasmtime::component::__internal::Vec, - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (&[SomeVariant],), @@ -2060,10 +1976,7 @@ pub mod exports { &self, mut store: S, arg0: &LoadStoreAllSizes, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (&LoadStoreAllSizes,), diff --git a/crates/component-macro/tests/expanded/many-arguments.rs b/crates/component-macro/tests/expanded/many-arguments.rs index 2f07d9504773..5d53f6019f8e 100644 --- a/crates/component-macro/tests/expanded/many-arguments.rs +++ b/crates/component-macro/tests/expanded/many-arguments.rs @@ -623,10 +623,7 @@ pub mod exports { arg13: u64, arg14: u64, arg15: u64, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< ( @@ -679,10 +676,7 @@ pub mod exports { &self, mut store: S, arg0: &BigStruct, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&BigStruct,), diff --git a/crates/component-macro/tests/expanded/multiversion.rs b/crates/component-macro/tests/expanded/multiversion.rs index 42ab45ac3405..28eba7d25fd7 100644 --- a/crates/component-macro/tests/expanded/multiversion.rs +++ b/crates/component-macro/tests/expanded/multiversion.rs @@ -349,10 +349,7 @@ pub mod exports { pub fn call_x( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -431,10 +428,7 @@ pub mod exports { pub fn call_x( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), diff --git a/crates/component-macro/tests/expanded/records.rs b/crates/component-macro/tests/expanded/records.rs index 7719009c6397..841331ab3a12 100644 --- a/crates/component-macro/tests/expanded/records.rs +++ b/crates/component-macro/tests/expanded/records.rs @@ -877,10 +877,7 @@ pub mod exports { &self, mut store: S, arg0: (char, u32), - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< ((char, u32),), @@ -894,10 +891,7 @@ pub mod exports { pub fn call_tuple_result( &self, mut store: S, - ) -> wasmtime::Result<(char, u32)> - where - ::Data: Send, - { + ) -> wasmtime::Result<(char, u32)> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -912,10 +906,7 @@ pub mod exports { &self, mut store: S, arg0: Empty, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (Empty,), @@ -929,10 +920,7 @@ pub mod exports { pub fn call_empty_result( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -947,10 +935,7 @@ pub mod exports { &self, mut store: S, arg0: Scalars, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (Scalars,), @@ -964,10 +949,7 @@ pub mod exports { pub fn call_scalar_result( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -982,10 +964,7 @@ pub mod exports { &self, mut store: S, arg0: ReallyFlags, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (ReallyFlags,), @@ -999,10 +978,7 @@ pub mod exports { pub fn call_flags_result( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1017,10 +993,7 @@ pub mod exports { &self, mut store: S, arg0: &Aggregates, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&Aggregates,), @@ -1034,10 +1007,7 @@ pub mod exports { pub fn call_aggregate_result( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1052,10 +1022,7 @@ pub mod exports { &self, mut store: S, arg0: TupleTypedef2, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (TupleTypedef2,), diff --git a/crates/component-macro/tests/expanded/resources-export.rs b/crates/component-macro/tests/expanded/resources-export.rs index 31ecd8d2e0a6..eed7fe99a03c 100644 --- a/crates/component-macro/tests/expanded/resources-export.rs +++ b/crates/component-macro/tests/expanded/resources-export.rs @@ -377,10 +377,7 @@ pub mod exports { pub fn call_constructor( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -394,10 +391,7 @@ pub mod exports { pub fn call_static_a( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -412,10 +406,7 @@ pub mod exports { &self, mut store: S, arg0: wasmtime::component::ResourceAny, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (wasmtime::component::ResourceAny,), @@ -535,10 +526,7 @@ pub mod exports { &self, mut store: S, arg0: wasmtime::component::Resource, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (wasmtime::component::Resource,), @@ -552,10 +540,7 @@ pub mod exports { pub fn call_static_a( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -571,10 +556,7 @@ pub mod exports { mut store: S, arg0: wasmtime::component::ResourceAny, arg1: wasmtime::component::Resource, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< ( @@ -668,10 +650,7 @@ pub mod exports { pub fn call_constructor( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -764,10 +743,7 @@ pub mod exports { &self, mut store: S, arg0: wasmtime::component::ResourceAny, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (wasmtime::component::ResourceAny,), diff --git a/crates/component-macro/tests/expanded/resources-import.rs b/crates/component-macro/tests/expanded/resources-import.rs index 5617456f4d90..464dd860a254 100644 --- a/crates/component-macro/tests/expanded/resources-import.rs +++ b/crates/component-macro/tests/expanded/resources-import.rs @@ -317,10 +317,7 @@ const _: () = { pub fn call_some_world_func2( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1197,10 +1194,7 @@ pub mod exports { &self, mut store: S, arg0: wasmtime::component::Resource, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (wasmtime::component::Resource,), diff --git a/crates/component-macro/tests/expanded/share-types.rs b/crates/component-macro/tests/expanded/share-types.rs index 48494002e72a..2bf8d36b335c 100644 --- a/crates/component-macro/tests/expanded/share-types.rs +++ b/crates/component-macro/tests/expanded/share-types.rs @@ -378,10 +378,7 @@ pub mod exports { &self, mut store: S, arg0: &Request, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (&Request,), diff --git a/crates/component-macro/tests/expanded/simple-functions.rs b/crates/component-macro/tests/expanded/simple-functions.rs index e5643c0d9ef8..31055f0ad749 100644 --- a/crates/component-macro/tests/expanded/simple-functions.rs +++ b/crates/component-macro/tests/expanded/simple-functions.rs @@ -391,10 +391,7 @@ pub mod exports { pub fn call_f1( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -409,10 +406,7 @@ pub mod exports { &self, mut store: S, arg0: u32, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (u32,), @@ -428,10 +422,7 @@ pub mod exports { mut store: S, arg0: u32, arg1: u32, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (u32, u32), @@ -445,10 +436,7 @@ pub mod exports { pub fn call_f4( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -462,10 +450,7 @@ pub mod exports { pub fn call_f5( &self, mut store: S, - ) -> wasmtime::Result<(u32, u32)> - where - ::Data: Send, - { + ) -> wasmtime::Result<(u32, u32)> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -482,10 +467,7 @@ pub mod exports { arg0: u32, arg1: u32, arg2: u32, - ) -> wasmtime::Result<(u32, u32, u32)> - where - ::Data: Send, - { + ) -> wasmtime::Result<(u32, u32, u32)> { let callee = unsafe { wasmtime::component::TypedFunc::< (u32, u32, u32), diff --git a/crates/component-macro/tests/expanded/simple-lists.rs b/crates/component-macro/tests/expanded/simple-lists.rs index e5c84d2c5179..25685c79a7fb 100644 --- a/crates/component-macro/tests/expanded/simple-lists.rs +++ b/crates/component-macro/tests/expanded/simple-lists.rs @@ -426,10 +426,7 @@ pub mod exports { &self, mut store: S, arg0: &[u32], - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&[u32],), @@ -443,10 +440,7 @@ pub mod exports { pub fn call_simple_list2( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -467,10 +461,7 @@ pub mod exports { wasmtime::component::__internal::Vec, wasmtime::component::__internal::Vec, ), - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (&[u32], &[u32]), @@ -494,10 +485,7 @@ pub mod exports { wasmtime::component::__internal::Vec< wasmtime::component::__internal::Vec, >, - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (&[wasmtime::component::__internal::Vec],), diff --git a/crates/component-macro/tests/expanded/small-anonymous.rs b/crates/component-macro/tests/expanded/small-anonymous.rs index 39fe52307cf6..b89a4fc16851 100644 --- a/crates/component-macro/tests/expanded/small-anonymous.rs +++ b/crates/component-macro/tests/expanded/small-anonymous.rs @@ -395,10 +395,7 @@ pub mod exports { mut store: S, ) -> wasmtime::Result< Result, Error>, - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (), diff --git a/crates/component-macro/tests/expanded/smoke-default.rs b/crates/component-macro/tests/expanded/smoke-default.rs index 7dbcfa49bd40..3e7bf72fff74 100644 --- a/crates/component-macro/tests/expanded/smoke-default.rs +++ b/crates/component-macro/tests/expanded/smoke-default.rs @@ -161,10 +161,7 @@ const _: () = { pub fn call_y( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::<(), ()>::new_unchecked(self.y) }; diff --git a/crates/component-macro/tests/expanded/smoke-export.rs b/crates/component-macro/tests/expanded/smoke-export.rs index 3919bba6c91e..4325a63d0969 100644 --- a/crates/component-macro/tests/expanded/smoke-export.rs +++ b/crates/component-macro/tests/expanded/smoke-export.rs @@ -210,10 +210,7 @@ pub mod exports { pub fn call_y( &self, mut store: S, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::<(), ()>::new_unchecked(self.y) }; diff --git a/crates/component-macro/tests/expanded/strings.rs b/crates/component-macro/tests/expanded/strings.rs index 5de55dedba80..08550ee849f4 100644 --- a/crates/component-macro/tests/expanded/strings.rs +++ b/crates/component-macro/tests/expanded/strings.rs @@ -348,10 +348,7 @@ pub mod exports { &self, mut store: S, arg0: &str, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&str,), @@ -365,10 +362,7 @@ pub mod exports { pub fn call_b( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -384,10 +378,7 @@ pub mod exports { mut store: S, arg0: &str, arg1: &str, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (&str, &str), diff --git a/crates/component-macro/tests/expanded/variants.rs b/crates/component-macro/tests/expanded/variants.rs index d7ea90fac136..7764fc390d96 100644 --- a/crates/component-macro/tests/expanded/variants.rs +++ b/crates/component-macro/tests/expanded/variants.rs @@ -1531,10 +1531,7 @@ pub mod exports { &self, mut store: S, arg0: E1, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (E1,), @@ -1548,10 +1545,7 @@ pub mod exports { pub fn call_e1_result( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1566,10 +1560,7 @@ pub mod exports { &self, mut store: S, arg0: &V1, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&V1,), @@ -1583,10 +1574,7 @@ pub mod exports { pub fn call_v1_result( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1601,10 +1589,7 @@ pub mod exports { &self, mut store: S, arg0: bool, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (bool,), @@ -1618,10 +1603,7 @@ pub mod exports { pub fn call_bool_result( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1641,10 +1623,7 @@ pub mod exports { arg3: Option, arg4: Option, arg5: Option>, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< ( @@ -1678,10 +1657,7 @@ pub mod exports { Option, Option>, ), - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1712,10 +1688,7 @@ pub mod exports { arg5: Casts6, ) -> wasmtime::Result< (Casts1, Casts2, Casts3, Casts4, Casts5, Casts6), - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (Casts1, Casts2, Casts3, Casts4, Casts5, Casts6), @@ -1739,10 +1712,7 @@ pub mod exports { arg3: Result<(), ()>, arg4: Result, arg5: Result<&str, &[u8]>, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< ( @@ -1779,10 +1749,7 @@ pub mod exports { wasmtime::component::__internal::Vec, >, ), - > - where - ::Data: Send, - { + > { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1808,10 +1775,7 @@ pub mod exports { pub fn call_return_result_sugar( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1825,10 +1789,7 @@ pub mod exports { pub fn call_return_result_sugar2( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1842,10 +1803,7 @@ pub mod exports { pub fn call_return_result_sugar3( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1859,10 +1817,7 @@ pub mod exports { pub fn call_return_result_sugar4( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1876,10 +1831,7 @@ pub mod exports { pub fn call_return_option_sugar( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1893,10 +1845,7 @@ pub mod exports { pub fn call_return_option_sugar2( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1910,10 +1859,7 @@ pub mod exports { pub fn call_result_simple( &self, mut store: S, - ) -> wasmtime::Result> - where - ::Data: Send, - { + ) -> wasmtime::Result> { let callee = unsafe { wasmtime::component::TypedFunc::< (), @@ -1928,10 +1874,7 @@ pub mod exports { &self, mut store: S, arg0: &IsClone, - ) -> wasmtime::Result<()> - where - ::Data: Send, - { + ) -> wasmtime::Result<()> { let callee = unsafe { wasmtime::component::TypedFunc::< (&IsClone,), @@ -1945,10 +1888,7 @@ pub mod exports { pub fn call_is_clone_return( &self, mut store: S, - ) -> wasmtime::Result - where - ::Data: Send, - { + ) -> wasmtime::Result { let callee = unsafe { wasmtime::component::TypedFunc::< (), diff --git a/crates/component-macro/tests/expanded/worlds-with-types.rs b/crates/component-macro/tests/expanded/worlds-with-types.rs index aa473cae5997..effc440ccf71 100644 --- a/crates/component-macro/tests/expanded/worlds-with-types.rs +++ b/crates/component-macro/tests/expanded/worlds-with-types.rs @@ -198,10 +198,7 @@ const _: () = { pub fn call_f( &self, mut store: S, - ) -> wasmtime::Result<(T, U, R)> - where - ::Data: Send, - { + ) -> wasmtime::Result<(T, U, R)> { let callee = unsafe { wasmtime::component::TypedFunc::<(), ((T, U, R),)>::new_unchecked(self.f) }; diff --git a/crates/wit-bindgen/src/lib.rs b/crates/wit-bindgen/src/lib.rs index 5d3f1ac69e4e..a3a36185439a 100644 --- a/crates/wit-bindgen/src/lib.rs +++ b/crates/wit-bindgen/src/lib.rs @@ -625,7 +625,7 @@ impl Wasmtime { ty = format!("{wt}::component::Func"); let sig = generator.typedfunc_sig(func, TypeMode::AllBorrowed("'_")); let typecheck = format!( - "match item {{ + "match item {{ {wt}::component::types::ComponentItem::ComponentFunc(func) => {{ anyhow::Context::context( func.typecheck::<{sig}>(&_instance_type), @@ -3176,13 +3176,21 @@ impl<'a> InterfaceGenerator<'a> { if concurrent { uwrite!(self.src, ">"); } + uwrite!(self.src, ">"); - let maybe_static = if concurrent { " + 'static" } else { "" }; - - uwrite!( - self.src, - "> where ::Data: Send{maybe_static} {{\n" - ); + match style { + CallStyle::Concurrent => { + uwrite!( + self.src, + " where ::Data: Send + 'static", + ); + } + CallStyle::Async => { + uwrite!(self.src, " where ::Data: Send"); + } + CallStyle::Sync => {} + } + uwrite!(self.src, "{{\n"); // TODO: support tracing concurrent calls if self.generator.opts.tracing && !concurrent { diff --git a/tests/all/component_model/bindgen.rs b/tests/all/component_model/bindgen.rs index e7a9b43345a2..0c36dd1966d8 100644 --- a/tests/all/component_model/bindgen.rs +++ b/tests/all/component_model/bindgen.rs @@ -12,6 +12,7 @@ mod results; mod no_imports { use super::*; + use std::rc::Rc; wasmtime::component::bindgen!({ inline: " @@ -53,6 +54,12 @@ mod no_imports { let no_imports = NoImports::instantiate(&mut store, &component, &linker)?; no_imports.call_bar(&mut store)?; no_imports.foo().call_foo(&mut store)?; + + let linker = Linker::new(&engine); + let mut non_send_store = Store::new(&engine, Rc::new(())); + let no_imports = NoImports::instantiate(&mut non_send_store, &component, &linker)?; + no_imports.call_bar(&mut non_send_store)?; + no_imports.foo().call_foo(&mut non_send_store)?; Ok(()) } }