@@ -42,7 +42,7 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
42
42
desc,
43
43
parent : Some ( did) ,
44
44
parent_idx : None ,
45
- search_type : get_index_search_type ( item, tcx, cache ) ,
45
+ search_type : get_index_search_type ( item, tcx) ,
46
46
aliases : item. attrs . get_doc_aliases ( ) ,
47
47
} ) ;
48
48
}
@@ -194,12 +194,11 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
194
194
crate fn get_index_search_type < ' tcx > (
195
195
item : & clean:: Item ,
196
196
tcx : TyCtxt < ' tcx > ,
197
- cache : & Cache ,
198
197
) -> Option < IndexItemFunctionType > {
199
198
let ( mut inputs, mut output) = match * item. kind {
200
- clean:: FunctionItem ( ref f) => get_all_types ( & f. generics , & f. decl , tcx, cache ) ,
201
- clean:: MethodItem ( ref m, _) => get_all_types ( & m. generics , & m. decl , tcx, cache ) ,
202
- clean:: TyMethodItem ( ref m) => get_all_types ( & m. generics , & m. decl , tcx, cache ) ,
199
+ clean:: FunctionItem ( ref f) => get_all_types ( & f. generics , & f. decl , tcx) ,
200
+ clean:: MethodItem ( ref m, _) => get_all_types ( & m. generics , & m. decl , tcx) ,
201
+ clean:: TyMethodItem ( ref m) => get_all_types ( & m. generics , & m. decl , tcx) ,
203
202
_ => return None ,
204
203
} ;
205
204
@@ -254,14 +253,12 @@ crate fn get_real_types<'tcx>(
254
253
tcx : TyCtxt < ' tcx > ,
255
254
recurse : usize ,
256
255
res : & mut Vec < TypeWithKind > ,
257
- cache : & Cache ,
258
256
) {
259
257
fn insert_ty (
260
258
res : & mut Vec < TypeWithKind > ,
261
259
tcx : TyCtxt < ' _ > ,
262
260
ty : Type ,
263
261
mut generics : Vec < TypeWithKind > ,
264
- _cache : & Cache ,
265
262
) {
266
263
let is_full_generic = ty. is_full_generic ( ) ;
267
264
@@ -350,32 +347,25 @@ crate fn get_real_types<'tcx>(
350
347
for param_def in poly_trait. generic_params . iter ( ) {
351
348
match & param_def. kind {
352
349
clean:: GenericParamDefKind :: Type { default : Some ( ty) , .. } => {
353
- get_real_types (
354
- generics,
355
- ty,
356
- tcx,
357
- recurse + 1 ,
358
- & mut ty_generics,
359
- cache,
360
- )
350
+ get_real_types ( generics, ty, tcx, recurse + 1 , & mut ty_generics)
361
351
}
362
352
_ => { }
363
353
}
364
354
}
365
355
}
366
356
}
367
- insert_ty ( res, tcx, arg. clone ( ) , ty_generics, cache ) ;
357
+ insert_ty ( res, tcx, arg. clone ( ) , ty_generics) ;
368
358
}
369
359
// Otherwise we check if the trait bounds are "inlined" like `T: Option<u32>`...
370
360
if let Some ( bound) = generics. params . iter ( ) . find ( |g| g. is_type ( ) && g. name == arg_s) {
371
361
let mut ty_generics = Vec :: new ( ) ;
372
362
for bound in bound. get_bounds ( ) . unwrap_or ( & [ ] ) {
373
363
if let Some ( path) = bound. get_trait_path ( ) {
374
364
let ty = Type :: Path { path } ;
375
- get_real_types ( generics, & ty, tcx, recurse + 1 , & mut ty_generics, cache ) ;
365
+ get_real_types ( generics, & ty, tcx, recurse + 1 , & mut ty_generics) ;
376
366
}
377
367
}
378
- insert_ty ( res, tcx, arg. clone ( ) , ty_generics, cache ) ;
368
+ insert_ty ( res, tcx, arg. clone ( ) , ty_generics) ;
379
369
}
380
370
} else {
381
371
// This is not a type parameter. So for example if we have `T, U: Option<T>`, and we're
@@ -386,10 +376,10 @@ crate fn get_real_types<'tcx>(
386
376
let mut ty_generics = Vec :: new ( ) ;
387
377
if let Some ( arg_generics) = arg. generics ( ) {
388
378
for gen in arg_generics. iter ( ) {
389
- get_real_types ( generics, gen, tcx, recurse + 1 , & mut ty_generics, cache ) ;
379
+ get_real_types ( generics, gen, tcx, recurse + 1 , & mut ty_generics) ;
390
380
}
391
381
}
392
- insert_ty ( res, tcx, arg. clone ( ) , ty_generics, cache ) ;
382
+ insert_ty ( res, tcx, arg. clone ( ) , ty_generics) ;
393
383
}
394
384
}
395
385
@@ -401,15 +391,14 @@ crate fn get_all_types<'tcx>(
401
391
generics : & Generics ,
402
392
decl : & FnDecl ,
403
393
tcx : TyCtxt < ' tcx > ,
404
- cache : & Cache ,
405
394
) -> ( Vec < TypeWithKind > , Vec < TypeWithKind > ) {
406
395
let mut all_types = Vec :: new ( ) ;
407
396
for arg in decl. inputs . values . iter ( ) {
408
397
if arg. type_ . is_self_type ( ) {
409
398
continue ;
410
399
}
411
400
let mut args = Vec :: new ( ) ;
412
- get_real_types ( generics, & arg. type_ , tcx, 0 , & mut args, cache ) ;
401
+ get_real_types ( generics, & arg. type_ , tcx, 0 , & mut args) ;
413
402
if !args. is_empty ( ) {
414
403
all_types. extend ( args) ;
415
404
} else {
@@ -423,7 +412,7 @@ crate fn get_all_types<'tcx>(
423
412
let mut ret_types = Vec :: new ( ) ;
424
413
match decl. output {
425
414
FnRetTy :: Return ( ref return_type) => {
426
- get_real_types ( generics, return_type, tcx, 0 , & mut ret_types, cache ) ;
415
+ get_real_types ( generics, return_type, tcx, 0 , & mut ret_types) ;
427
416
if ret_types. is_empty ( ) {
428
417
if let Some ( kind) =
429
418
return_type. def_id_no_primitives ( ) . map ( |did| tcx. def_kind ( did) . into ( ) )
0 commit comments