@@ -347,7 +347,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
347
347
assert ! ( self_ty. is_some( ) ) ;
348
348
}
349
349
} else {
350
- assert ! ( self_ty. is_none( ) && parent_substs . is_empty ( ) ) ;
350
+ assert ! ( self_ty. is_none( ) ) ;
351
351
}
352
352
353
353
let arg_count = Self :: check_generic_arg_count (
@@ -1821,7 +1821,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1821
1821
1822
1822
// Check if we have an enum variant.
1823
1823
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 ( ) {
1825
1825
if adt_def. is_enum ( ) {
1826
1826
let variant_def = adt_def
1827
1827
. variants ( )
@@ -1923,8 +1923,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1923
1923
let Some ( assoc_ty_did) = self . lookup_assoc_ty ( assoc_ident, hir_ref_id, span, impl_) else {
1924
1924
continue ;
1925
1925
} ;
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) ;
1928
1933
return Ok ( ( ty, DefKind :: AssocTy , assoc_ty_did) ) ;
1929
1934
}
1930
1935
}
0 commit comments