@@ -118,6 +118,12 @@ fn associated_item_from_impl_item_ref(impl_item_ref: &hir::ImplItemRef) -> ty::A
118118 }
119119}
120120
121+ /// Given an `fn_def_id` of a trait or of an impl that implements a given trait:
122+ /// if `fn_def_id` is the def id of a function defined inside a trait, then it creates and returns
123+ /// the associated items that correspond to each impl trait in return position for that trait.
124+ /// if `fn_def_id` is the def id of a function defined inside an impl that implements a trait, then it
125+ /// creates and returns the associated items that correspond to each impl trait in return position
126+ /// of the implemented trait.
121127fn associated_items_for_impl_trait_in_trait ( tcx : TyCtxt < ' _ > , fn_def_id : DefId ) -> & ' _ [ DefId ] {
122128 let parent_def_id = tcx. parent ( fn_def_id) ;
123129
@@ -174,6 +180,8 @@ fn associated_items_for_impl_trait_in_trait(tcx: TyCtxt<'_>, fn_def_id: DefId) -
174180 }
175181}
176182
183+ /// Given an `opaque_ty_def_id` corresponding to an impl trait in trait, create and return the
184+ /// corresponding associated item.
177185fn associated_item_for_impl_trait_in_trait (
178186 tcx : TyCtxt < ' _ > ,
179187 opaque_ty_def_id : LocalDefId ,
@@ -188,6 +196,9 @@ fn associated_item_for_impl_trait_in_trait(
188196 trait_assoc_ty. def_id ( )
189197}
190198
199+ /// Given an `trait_assoc_def_id` that corresponds to a previously synthethized impl trait in trait
200+ /// into an associated type and an `impl_def_id` corresponding to an impl block, create and return
201+ /// the corresponding associated item inside the impl block.
191202fn impl_associated_item_for_impl_trait_in_trait (
192203 tcx : TyCtxt < ' _ > ,
193204 trait_assoc_def_id : LocalDefId ,
0 commit comments