@@ -347,7 +347,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
347347 assert ! ( self_ty. is_some( ) ) ;
348348 }
349349 } else {
350- assert ! ( self_ty. is_none( ) && parent_substs . is_empty ( ) ) ;
350+ assert ! ( self_ty. is_none( ) ) ;
351351 }
352352
353353 let arg_count = Self :: check_generic_arg_count (
@@ -1821,7 +1821,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
18211821
18221822 // Check if we have an enum variant.
18231823 let mut variant_resolution = None ;
1824- if let ty:: Adt ( adt_def, _ ) = qself_ty. kind ( ) {
1824+ if let ty:: Adt ( adt_def, adt_substs ) = qself_ty. kind ( ) {
18251825 if adt_def. is_enum ( ) {
18261826 let variant_def = adt_def
18271827 . variants ( )
@@ -1923,8 +1923,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
19231923 let Some ( assoc_ty_did) = self . lookup_assoc_ty ( assoc_ident, hir_ref_id, span, impl_) else {
19241924 continue ;
19251925 } ;
1926- // FIXME(inherent_associated_types): This does not substitute parameters.
1927- let ty = tcx. type_of ( assoc_ty_did) ;
1926+ let item_substs = self . create_substs_for_associated_item (
1927+ span,
1928+ assoc_ty_did,
1929+ assoc_segment,
1930+ adt_substs,
1931+ ) ;
1932+ let ty = tcx. bound_type_of ( assoc_ty_did) . subst ( tcx, item_substs) ;
19281933 return Ok ( ( ty, DefKind :: AssocTy , assoc_ty_did) ) ;
19291934 }
19301935 }
0 commit comments