@@ -79,9 +79,9 @@ pub(crate) fn ty_args_to_args<'tcx>(
7979 cx : & mut DocContext < ' tcx > ,
8080 ty_args : ty:: Binder < ' tcx , & ' tcx [ ty:: GenericArg < ' tcx > ] > ,
8181 has_self : bool ,
82- container : Option < DefId > ,
82+ owner : DefId ,
8383) -> Vec < GenericArg > {
84- let params = container . map ( |container| & cx. tcx . generics_of ( container ) . params ) ;
84+ let params = & cx. tcx . generics_of ( owner ) . params ;
8585 let mut elision_has_failed_once_before = false ;
8686
8787 let offset = if has_self { 1 } else { 0 } ;
@@ -94,7 +94,6 @@ pub(crate) fn ty_args_to_args<'tcx>(
9494 GenericArgKind :: Type ( _) if has_self && index == 0 => None ,
9595 GenericArgKind :: Type ( ty) => {
9696 if !elision_has_failed_once_before
97- && let Some ( params) = params
9897 && let Some ( default) = params[ index] . default_value ( cx. tcx )
9998 {
10099 let default =
@@ -111,8 +110,8 @@ pub(crate) fn ty_args_to_args<'tcx>(
111110 ty_args. rebind ( ty) ,
112111 cx,
113112 None ,
114- container . map ( |container| crate :: clean:: ContainerTy :: Regular {
115- ty : container ,
113+ Some ( crate :: clean:: ContainerTy :: Regular {
114+ ty : owner ,
116115 args : ty_args,
117116 has_self,
118117 arg : index,
@@ -130,7 +129,6 @@ pub(crate) fn ty_args_to_args<'tcx>(
130129 }
131130
132131 if !elision_has_failed_once_before
133- && let Some ( params) = params
134132 && let Some ( default) = params[ index] . default_value ( cx. tcx )
135133 {
136134 let default =
@@ -200,7 +198,7 @@ fn external_generic_args<'tcx>(
200198 bindings : ThinVec < TypeBinding > ,
201199 ty_args : ty:: Binder < ' tcx , GenericArgsRef < ' tcx > > ,
202200) -> GenericArgs {
203- let args = ty_args_to_args ( cx, ty_args. map_bound ( |args| & args[ ..] ) , has_self, Some ( did) ) ;
201+ let args = ty_args_to_args ( cx, ty_args. map_bound ( |args| & args[ ..] ) , has_self, did) ;
204202
205203 if cx. tcx . fn_trait_kind_from_def_id ( did) . is_some ( ) {
206204 let ty = ty_args
0 commit comments