@@ -7,7 +7,7 @@ use rustc_span::symbol::Symbol;
7
7
use serde:: ser:: { Serialize , SerializeStruct , Serializer } ;
8
8
9
9
use crate :: clean;
10
- use crate :: clean:: types:: { FnDecl , FnRetTy , GenericBound , Generics , Type , WherePredicate } ;
10
+ use crate :: clean:: types:: { FnRetTy , Function , GenericBound , Generics , Type , WherePredicate } ;
11
11
use crate :: formats:: cache:: Cache ;
12
12
use crate :: formats:: item_type:: ItemType ;
13
13
use crate :: html:: markdown:: short_markdown_summary;
@@ -186,9 +186,9 @@ crate fn get_index_search_type<'tcx>(
186
186
tcx : TyCtxt < ' tcx > ,
187
187
) -> Option < IndexItemFunctionType > {
188
188
let ( mut inputs, mut output) = match * item. kind {
189
- clean:: FunctionItem ( ref f) => get_all_types ( & f . generics , & f . decl , tcx) ,
190
- clean:: MethodItem ( ref m, _) => get_all_types ( & m . generics , & m . decl , tcx) ,
191
- clean:: TyMethodItem ( ref m) => get_all_types ( & m . generics , & m . decl , tcx) ,
189
+ clean:: FunctionItem ( ref f) => get_all_types ( f , tcx) ,
190
+ clean:: MethodItem ( ref m, _) => get_all_types ( m , tcx) ,
191
+ clean:: TyMethodItem ( ref m) => get_all_types ( m , tcx) ,
192
192
_ => return None ,
193
193
} ;
194
194
@@ -378,10 +378,12 @@ fn get_real_types<'tcx>(
378
378
/// i.e. `fn foo<A: Display, B: Option<A>>(x: u32, y: B)` will return
379
379
/// `[u32, Display, Option]`.
380
380
fn get_all_types < ' tcx > (
381
- generics : & Generics ,
382
- decl : & FnDecl ,
381
+ func : & Function ,
383
382
tcx : TyCtxt < ' tcx > ,
384
383
) -> ( Vec < TypeWithKind > , Vec < TypeWithKind > ) {
384
+ let decl = & func. decl ;
385
+ let generics = & func. generics ;
386
+
385
387
let mut all_types = Vec :: new ( ) ;
386
388
for arg in decl. inputs . values . iter ( ) {
387
389
if arg. type_ . is_self_type ( ) {
0 commit comments