Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 10355ff

Browse files
authored
Merge pull request #177 from alexcrichton/re-enable-concurrent-expanded-tests
Re-enable concurrent expansion tests
2 parents ac26e71 + e60e388 commit 10355ff

30 files changed

Lines changed: 58 additions & 4600 deletions

crates/component-macro/tests/expanded.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ macro_rules! genexpand {
1515
stringify: true,
1616
}))?;
1717

18-
// TODO: re-enable this when wasip3 is merged back into this repo
19-
// process_expanded($path, "_concurrent", wasmtime::component::bindgen!({
20-
// path: $path,
21-
// async: true,
22-
// concurrent_imports: true,
23-
// concurrent_exports: true,
24-
// stringify: true,
25-
// }))?;
18+
process_expanded($path, "_concurrent", wasmtime::component::bindgen!({
19+
path: $path,
20+
async: true,
21+
concurrent_imports: true,
22+
concurrent_exports: true,
23+
stringify: true,
24+
}))?;
2625

2726
process_expanded($path, "_tracing_async", wasmtime::component::bindgen!({
2827
path: $path,

crates/component-macro/tests/expanded/char_concurrent.rs

Lines changed: 1 addition & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,9 @@ const _: () = {
155155
host_getter: fn(&mut T) -> D::Data<'_>,
156156
) -> wasmtime::Result<()>
157157
where
158-
<<<<<<< HEAD
159158
D: foo::foo::chars::HostConcurrent + Send,
160159
for<'a> D::Data<'a>: foo::foo::chars::Host + Send,
161160
T: 'static + Send,
162-
||||||| 40315bd2c
163-
T: Send + foo::foo::chars::Host<Data = T> + 'static,
164-
U: Send + foo::foo::chars::Host<Data = T>,
165-
=======
166-
T: 'static,
167-
T: Send + foo::foo::chars::Host<Data = T>,
168-
U: Send + foo::foo::chars::Host<Data = T>,
169-
>>>>>>> upstream/main
170161
{
171162
foo::foo::chars::add_to_linker::<T, D>(linker, host_getter)?;
172163
Ok(())
@@ -198,50 +189,17 @@ pub mod foo {
198189
where
199190
Self: Sized;
200191
}
201-
<<<<<<< HEAD
202192
#[wasmtime::component::__internal::trait_variant_make(::core::marker::Send)]
203193
pub trait Host: Send {}
204-
impl<_T: Host + Send> Host for &mut _T {}
194+
impl<_T: Host + ?Sized + Send> Host for &mut _T {}
205195
pub fn add_to_linker<T, D>(
206-
||||||| 40315bd2c
207-
pub trait GetHost<
208-
T,
209-
D,
210-
>: Fn(T) -> <Self as GetHost<T, D>>::Host + Send + Sync + Copy + 'static {
211-
type Host: Host<Data = D> + Send;
212-
}
213-
impl<F, T, D, O> GetHost<T, D> for F
214-
where
215-
F: Fn(T) -> O + Send + Sync + Copy + 'static,
216-
O: Host<Data = D> + Send,
217-
{
218-
type Host = O;
219-
}
220-
pub fn add_to_linker_get_host<
221-
T,
222-
G: for<'a> GetHost<&'a mut T, T, Host: Host<Data = T> + Send>,
223-
>(
224-
=======
225-
pub fn add_to_linker_get_host<T, G>(
226-
>>>>>>> upstream/main
227196
linker: &mut wasmtime::component::Linker<T>,
228197
host_getter: fn(&mut T) -> D::Data<'_>,
229198
) -> wasmtime::Result<()>
230199
where
231-
<<<<<<< HEAD
232200
D: HostConcurrent,
233201
for<'a> D::Data<'a>: Host,
234202
T: 'static + Send,
235-
||||||| 40315bd2c
236-
T: Send + 'static,
237-
=======
238-
T: 'static,
239-
G: for<'a> wasmtime::component::GetHost<
240-
&'a mut T,
241-
Host: Host<Data = T> + Send,
242-
>,
243-
T: Send + 'static,
244-
>>>>>>> upstream/main
245203
{
246204
let mut inst = linker.instance("foo:foo/chars")?;
247205
inst.func_wrap_concurrent(
@@ -270,91 +228,6 @@ pub mod foo {
270228
)?;
271229
Ok(())
272230
}
273-
<<<<<<< HEAD
274-
||||||| 40315bd2c
275-
pub fn add_to_linker<T, U>(
276-
linker: &mut wasmtime::component::Linker<T>,
277-
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
278-
) -> wasmtime::Result<()>
279-
where
280-
U: Host<Data = T> + Send,
281-
T: Send + 'static,
282-
{
283-
add_to_linker_get_host(linker, get)
284-
}
285-
impl<_T: Host> Host for &mut _T {
286-
type Data = _T::Data;
287-
/// A function that accepts a character
288-
fn take_char(
289-
store: wasmtime::StoreContextMut<'_, Self::Data>,
290-
x: char,
291-
) -> impl ::core::future::Future<
292-
Output = impl FnOnce(
293-
wasmtime::StoreContextMut<'_, Self::Data>,
294-
) -> () + Send + Sync + 'static,
295-
> + Send + Sync + 'static
296-
where
297-
Self: Sized,
298-
{
299-
<_T as Host>::take_char(store, x)
300-
}
301-
/// A function that returns a character
302-
fn return_char(
303-
store: wasmtime::StoreContextMut<'_, Self::Data>,
304-
) -> impl ::core::future::Future<
305-
Output = impl FnOnce(
306-
wasmtime::StoreContextMut<'_, Self::Data>,
307-
) -> char + Send + Sync + 'static,
308-
> + Send + Sync + 'static
309-
where
310-
Self: Sized,
311-
{
312-
<_T as Host>::return_char(store)
313-
}
314-
}
315-
=======
316-
pub fn add_to_linker<T, U>(
317-
linker: &mut wasmtime::component::Linker<T>,
318-
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
319-
) -> wasmtime::Result<()>
320-
where
321-
T: 'static,
322-
U: Host<Data = T> + Send,
323-
T: Send + 'static,
324-
{
325-
add_to_linker_get_host(linker, get)
326-
}
327-
impl<_T: Host> Host for &mut _T {
328-
type Data = _T::Data;
329-
/// A function that accepts a character
330-
fn take_char(
331-
store: wasmtime::StoreContextMut<'_, Self::Data>,
332-
x: char,
333-
) -> impl ::core::future::Future<
334-
Output = impl FnOnce(
335-
wasmtime::StoreContextMut<'_, Self::Data>,
336-
) -> () + Send + Sync + 'static,
337-
> + Send + Sync + 'static
338-
where
339-
Self: Sized,
340-
{
341-
<_T as Host>::take_char(store, x)
342-
}
343-
/// A function that returns a character
344-
fn return_char(
345-
store: wasmtime::StoreContextMut<'_, Self::Data>,
346-
) -> impl ::core::future::Future<
347-
Output = impl FnOnce(
348-
wasmtime::StoreContextMut<'_, Self::Data>,
349-
) -> char + Send + Sync + 'static,
350-
> + Send + Sync + 'static
351-
where
352-
Self: Sized,
353-
{
354-
<_T as Host>::return_char(store)
355-
}
356-
}
357-
>>>>>>> upstream/main
358231
}
359232
}
360233
}

0 commit comments

Comments
 (0)