@@ -79,9 +79,9 @@ pub(crate) fn ty_args_to_args<'tcx>(
79
79
cx : & mut DocContext < ' tcx > ,
80
80
ty_args : ty:: Binder < ' tcx , & ' tcx [ ty:: GenericArg < ' tcx > ] > ,
81
81
has_self : bool ,
82
- container : Option < DefId > ,
82
+ owner : DefId ,
83
83
) -> Vec < GenericArg > {
84
- let params = container . map ( |container| & cx. tcx . generics_of ( container ) . params ) ;
84
+ let params = & cx. tcx . generics_of ( owner ) . params ;
85
85
let mut elision_has_failed_once_before = false ;
86
86
87
87
let offset = if has_self { 1 } else { 0 } ;
@@ -94,7 +94,6 @@ pub(crate) fn ty_args_to_args<'tcx>(
94
94
GenericArgKind :: Type ( _) if has_self && index == 0 => None ,
95
95
GenericArgKind :: Type ( ty) => {
96
96
if !elision_has_failed_once_before
97
- && let Some ( params) = params
98
97
&& let Some ( default) = params[ index] . default_value ( cx. tcx )
99
98
{
100
99
let default =
@@ -111,8 +110,8 @@ pub(crate) fn ty_args_to_args<'tcx>(
111
110
ty_args. rebind ( ty) ,
112
111
cx,
113
112
None ,
114
- container . map ( |container| crate :: clean:: ContainerTy :: Regular {
115
- ty : container ,
113
+ Some ( crate :: clean:: ContainerTy :: Regular {
114
+ ty : owner ,
116
115
args : ty_args,
117
116
has_self,
118
117
arg : index,
@@ -130,7 +129,6 @@ pub(crate) fn ty_args_to_args<'tcx>(
130
129
}
131
130
132
131
if !elision_has_failed_once_before
133
- && let Some ( params) = params
134
132
&& let Some ( default) = params[ index] . default_value ( cx. tcx )
135
133
{
136
134
let default =
@@ -200,7 +198,7 @@ fn external_generic_args<'tcx>(
200
198
bindings : ThinVec < TypeBinding > ,
201
199
ty_args : ty:: Binder < ' tcx , GenericArgsRef < ' tcx > > ,
202
200
) -> 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) ;
204
202
205
203
if cx. tcx . fn_trait_kind_from_def_id ( did) . is_some ( ) {
206
204
let ty = ty_args
0 commit comments