@@ -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- ||||||| 40315 bd2c
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- ||||||| 40315 bd2c
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- ||||||| 40315 bd2c
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- ||||||| 40315 bd2c
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