@@ -196,7 +196,7 @@ pub fn async_import_abi_area_types<'a>(
196196 let include_params = sig. indirect_params ;
197197 func. params
198198 . iter ( )
199- . filter_map ( move |( _ , ty ) | if include_params { Some ( ty) } else { None } )
199+ . filter_map ( move |p | if include_params { Some ( & p . ty ) } else { None } )
200200 . chain ( func. result . iter ( ) )
201201}
202202
@@ -414,7 +414,11 @@ pub fn task_return(
414414 let mut dummy_func = func. clone ( ) ;
415415 dummy_func. params = Vec :: new ( ) ;
416416 if let Some ( ty) = dummy_func. result . take ( ) {
417- dummy_func. params . push ( ( "x" . to_string ( ) , ty) ) ;
417+ dummy_func. params . push ( wit_parser:: Param {
418+ name : "x" . to_string ( ) ,
419+ ty,
420+ span : Default :: default ( ) ,
421+ } ) ;
418422 }
419423 import (
420424 adapter,
@@ -618,10 +622,7 @@ impl<'a> FunctionCompiler<'a> {
618622 // the responsibility of the caller to provide an appropriate parameter.
619623 let ( abi_param_size, abi_param_align) = match abi {
620624 AbiVariant :: GuestImport if sig. indirect_params => {
621- let info = self
622- . adapter
623- . sizes
624- . params ( func. params . iter ( ) . map ( |( _, ty) | ty) ) ;
625+ let info = self . adapter . sizes . params ( func. params . iter ( ) . map ( |p| & p. ty ) ) ;
625626 (
626627 info. size . size_wasm32 ( ) . try_into ( ) . unwrap ( ) ,
627628 info. align . align_wasm32 ( ) . try_into ( ) . unwrap ( ) ,
@@ -700,7 +701,7 @@ impl<'a> FunctionCompiler<'a> {
700701 indirect_params : impl FnOnce ( & Self ) -> Memory ,
701702 retptr : impl FnOnce ( & Self ) -> Memory ,
702703 ) {
703- let tys = func. params . iter ( ) . map ( |( _ , ty ) | ty) ;
704+ let tys = func. params . iter ( ) . map ( |p| & p . ty ) ;
704705
705706 if sig. indirect_params {
706707 let mem = indirect_params ( self ) ;
@@ -721,10 +722,8 @@ impl<'a> FunctionCompiler<'a> {
721722 if sig. retptr {
722723 self . free_temp_local ( locals. pop ( ) . unwrap ( ) ) ;
723724 }
724- let dsts = self . record_field_locs (
725- & AbiLoc :: Stack ( & locals) ,
726- func. params . iter ( ) . map ( |( _, ty) | ty) ,
727- ) ;
725+ let dsts =
726+ self . record_field_locs ( & AbiLoc :: Stack ( & locals) , func. params . iter ( ) . map ( |p| & p. ty ) ) ;
728727 for ( param, dst) in tys. zip ( dsts) {
729728 self . lower ( * param, & dst) ;
730729 }
@@ -783,20 +782,17 @@ impl<'a> FunctionCompiler<'a> {
783782 AbiLoc :: Stack ( & temps)
784783 } ;
785784
786- let srcs = self . record_field_locs ( & src, func. params . iter ( ) . map ( |( _ , ty ) | ty) ) ;
787- for ( ( _ , param) , src) in func. params . iter ( ) . zip ( srcs) {
788- self . lift ( & src, * param) ;
785+ let srcs = self . record_field_locs ( & src, func. params . iter ( ) . map ( |p| & p . ty ) ) ;
786+ for ( param, src) in func. params . iter ( ) . zip ( srcs) {
787+ self . lift ( & src, param. ty ) ;
789788 }
790789
791790 // If parameters were passed indirectly than the caller of this export
792791 // made a dynamic allocation with `cabi_realloc`. Cleanup said
793792 // allocation here after all the parameters were lowered onto the stack.
794793 if let AbiLoc :: Memory ( mem) = & src {
795794 assert ! ( sig. indirect_params) ;
796- let info = self
797- . adapter
798- . sizes
799- . record ( func. params . iter ( ) . map ( |( _, ty) | ty) ) ;
795+ let info = self . adapter . sizes . record ( func. params . iter ( ) . map ( |p| & p. ty ) ) ;
800796 self . local_get_ctx ( ) ;
801797 self . ins ( ) . local_get ( mem. addr . idx ) ;
802798 assert_eq ! ( mem. offset, 0 ) ;
0 commit comments