@@ -672,13 +672,6 @@ impl ItemTransCtx<'_, '_> {
672672 TraitRefKind :: SelfId ,
673673 RegionBinder :: empty ( self . translate_trait_predicate ( span, self_predicate) ?) ,
674674 ) ;
675- let items: Vec < ( TraitItemName , & hax:: AssocItem ) > = items
676- . iter ( )
677- . map ( |item| -> Result < _ , Error > {
678- let name = self . t_ctx . translate_trait_item_name ( & item. def_id ) ?;
679- Ok ( ( name, item) )
680- } )
681- . try_collect ( ) ?;
682675
683676 // Translate the associated items
684677 let mut consts = Vec :: new ( ) ;
@@ -701,8 +694,9 @@ impl ItemTransCtx<'_, '_> {
701694 } ) ;
702695 }
703696
704- for & ( item_name , hax_item) in & items {
697+ for hax_item in items {
705698 let item_def_id = & hax_item. def_id ;
699+ let item_name = self . t_ctx . translate_trait_item_name ( item_def_id) ?;
706700 let item_span = self . def_span ( item_def_id) ;
707701
708702 // In --mono mode, we keep only non-polymorphic items; in not-mono mode, we use the
@@ -718,7 +712,7 @@ impl ItemTransCtx<'_, '_> {
718712 let attr_info = self . translate_attr_info ( & item_def) ;
719713
720714 match item_def. kind ( ) {
721- hax:: FullDefKind :: AssocFn { .. } => {
715+ hax:: FullDefKind :: AssocFn { sig , .. } => {
722716 let method_id = self . register_no_enqueue ( item_span, & item_src) ;
723717 // Register this method.
724718 self . register_method_impl ( def_id, item_name, method_id) ;
@@ -752,9 +746,14 @@ impl ItemTransCtx<'_, '_> {
752746 id : method_id,
753747 generics : Box :: new ( fun_generics) ,
754748 } ;
749+ // `skip_binder` is allowed because `translate_binder_for_def` puts the
750+ // late bound params in scope.
751+ let signature =
752+ bt_ctx. translate_fun_sig ( span, sig. hax_skip_binder_ref ( ) ) ?;
755753 Ok ( TraitMethod {
756754 name : item_name,
757755 attr_info,
756+ signature,
758757 item : fn_ref,
759758 } )
760759 } ,
@@ -884,10 +883,21 @@ impl ItemTransCtx<'_, '_> {
884883 let ( method_name, method_binder) =
885884 self . prepare_drop_in_place_method ( def, span, def_id, None ) ;
886885 self . mark_method_as_used ( def_id, method_name) ;
887- methods. push ( method_binder. map ( |fn_ref| TraitMethod {
888- name : method_name,
889- attr_info : AttrInfo :: dummy_public ( ) ,
890- item : fn_ref,
886+ methods. push ( method_binder. map ( |fn_ref| {
887+ let self_ty = if self . monomorphize ( ) {
888+ // FIXME: put something real here
889+ Ty :: mk_unit ( )
890+ } else {
891+ TyKind :: TypeVar ( DeBruijnVar :: bound ( DeBruijnId :: one ( ) , TypeVarId :: ZERO ) )
892+ . into_ty ( )
893+ } ;
894+ let signature = self . drop_in_place_method_sig ( self_ty) ;
895+ TraitMethod {
896+ name : method_name,
897+ item : fn_ref,
898+ attr_info : AttrInfo :: dummy_public ( ) ,
899+ signature,
900+ }
891901 } ) ) ;
892902 }
893903
0 commit comments