@@ -173,9 +173,9 @@ crate fn get_index_search_type<'tcx>(
173
173
tcx : TyCtxt < ' tcx > ,
174
174
) -> Option < IndexItemFunctionType > {
175
175
let ( all_types, ret_types) = match * item. kind {
176
- clean:: FunctionItem ( ref f) => get_all_types ( & f. generics , & f. decl , tcx, & cache ) ,
177
- clean:: MethodItem ( ref m, _) => get_all_types ( & m. generics , & m. decl , tcx, & cache ) ,
178
- clean:: TyMethodItem ( ref m) => get_all_types ( & m. generics , & m. decl , tcx, & cache ) ,
176
+ clean:: FunctionItem ( ref f) => get_all_types ( & f. generics , & f. decl , tcx) ,
177
+ clean:: MethodItem ( ref m, _) => get_all_types ( & m. generics , & m. decl , tcx) ,
178
+ clean:: TyMethodItem ( ref m) => get_all_types ( & m. generics , & m. decl , tcx) ,
179
179
_ => return None ,
180
180
} ;
181
181
@@ -257,7 +257,6 @@ crate fn get_real_types<'tcx>(
257
257
arg : & Type ,
258
258
tcx : TyCtxt < ' tcx > ,
259
259
recurse : i32 ,
260
- cache : & Cache ,
261
260
res : & mut FxHashSet < ( Type , TypeKind ) > ,
262
261
) -> usize {
263
262
fn insert ( res : & mut FxHashSet < ( Type , TypeKind ) > , tcx : TyCtxt < ' _ > , ty : Type ) -> usize {
@@ -279,8 +278,7 @@ crate fn get_real_types<'tcx>(
279
278
}
280
279
let mut nb_added = 0 ;
281
280
282
- if arg. is_full_generic ( ) {
283
- let arg_s = Symbol :: intern ( & arg. print ( cache) . to_string ( ) ) ;
281
+ if let & Type :: Generic ( arg_s) = arg {
284
282
if let Some ( where_pred) = generics. where_predicates . iter ( ) . find ( |g| match g {
285
283
WherePredicate :: BoundPredicate { ty, .. } => ty. def_id ( ) == arg. def_id ( ) ,
286
284
_ => false ,
@@ -293,7 +291,7 @@ crate fn get_real_types<'tcx>(
293
291
continue ;
294
292
}
295
293
if let Some ( ty) = x. get_type ( ) {
296
- let adds = get_real_types ( generics, & ty, tcx, recurse + 1 , cache , res) ;
294
+ let adds = get_real_types ( generics, & ty, tcx, recurse + 1 , res) ;
297
295
nb_added += adds;
298
296
if adds == 0 && !ty. is_full_generic ( ) {
299
297
nb_added += insert ( res, tcx, ty) ;
@@ -306,7 +304,7 @@ crate fn get_real_types<'tcx>(
306
304
if let Some ( bound) = generics. params . iter ( ) . find ( |g| g. is_type ( ) && g. name == arg_s) {
307
305
for bound in bound. get_bounds ( ) . unwrap_or ( & [ ] ) {
308
306
if let Some ( ty) = bound. get_trait_type ( ) {
309
- let adds = get_real_types ( generics, & ty, tcx, recurse + 1 , cache , res) ;
307
+ let adds = get_real_types ( generics, & ty, tcx, recurse + 1 , res) ;
310
308
nb_added += adds;
311
309
if adds == 0 && !ty. is_full_generic ( ) {
312
310
nb_added += insert ( res, tcx, ty) ;
@@ -319,7 +317,7 @@ crate fn get_real_types<'tcx>(
319
317
if let Some ( gens) = arg. generics ( ) {
320
318
for gen in gens. iter ( ) {
321
319
if gen. is_full_generic ( ) {
322
- nb_added += get_real_types ( generics, gen, tcx, recurse + 1 , cache , res) ;
320
+ nb_added += get_real_types ( generics, gen, tcx, recurse + 1 , res) ;
323
321
} else {
324
322
nb_added += insert ( res, tcx, ( * gen) . clone ( ) ) ;
325
323
}
@@ -337,15 +335,14 @@ crate fn get_all_types<'tcx>(
337
335
generics : & Generics ,
338
336
decl : & FnDecl ,
339
337
tcx : TyCtxt < ' tcx > ,
340
- cache : & Cache ,
341
338
) -> ( Vec < ( Type , TypeKind ) > , Vec < ( Type , TypeKind ) > ) {
342
339
let mut all_types = FxHashSet :: default ( ) ;
343
340
for arg in decl. inputs . values . iter ( ) {
344
341
if arg. type_ . is_self_type ( ) {
345
342
continue ;
346
343
}
347
344
let mut args = FxHashSet :: default ( ) ;
348
- get_real_types ( generics, & arg. type_ , tcx, 0 , cache , & mut args) ;
345
+ get_real_types ( generics, & arg. type_ , tcx, 0 , & mut args) ;
349
346
if !args. is_empty ( ) {
350
347
all_types. extend ( args) ;
351
348
} else {
@@ -358,7 +355,7 @@ crate fn get_all_types<'tcx>(
358
355
let ret_types = match decl. output {
359
356
FnRetTy :: Return ( ref return_type) => {
360
357
let mut ret = FxHashSet :: default ( ) ;
361
- get_real_types ( generics, & return_type, tcx, 0 , cache , & mut ret) ;
358
+ get_real_types ( generics, & return_type, tcx, 0 , & mut ret) ;
362
359
if ret. is_empty ( ) {
363
360
if let Some ( kind) = return_type. def_id ( ) . map ( |did| tcx. def_kind ( did) . into ( ) ) {
364
361
ret. insert ( ( return_type. clone ( ) , kind) ) ;
0 commit comments