@@ -173,9 +173,9 @@ crate fn get_index_search_type<'tcx>(
173173 tcx : TyCtxt < ' tcx > ,
174174) -> Option < IndexItemFunctionType > {
175175 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) ,
179179 _ => return None ,
180180 } ;
181181
@@ -257,7 +257,6 @@ crate fn get_real_types<'tcx>(
257257 arg : & Type ,
258258 tcx : TyCtxt < ' tcx > ,
259259 recurse : i32 ,
260- cache : & Cache ,
261260 res : & mut FxHashSet < ( Type , TypeKind ) > ,
262261) -> usize {
263262 fn insert ( res : & mut FxHashSet < ( Type , TypeKind ) > , tcx : TyCtxt < ' _ > , ty : Type ) -> usize {
@@ -279,8 +278,7 @@ crate fn get_real_types<'tcx>(
279278 }
280279 let mut nb_added = 0 ;
281280
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 {
284282 if let Some ( where_pred) = generics. where_predicates . iter ( ) . find ( |g| match g {
285283 WherePredicate :: BoundPredicate { ty, .. } => ty. def_id ( ) == arg. def_id ( ) ,
286284 _ => false ,
@@ -293,7 +291,7 @@ crate fn get_real_types<'tcx>(
293291 continue ;
294292 }
295293 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) ;
297295 nb_added += adds;
298296 if adds == 0 && !ty. is_full_generic ( ) {
299297 nb_added += insert ( res, tcx, ty) ;
@@ -306,7 +304,7 @@ crate fn get_real_types<'tcx>(
306304 if let Some ( bound) = generics. params . iter ( ) . find ( |g| g. is_type ( ) && g. name == arg_s) {
307305 for bound in bound. get_bounds ( ) . unwrap_or ( & [ ] ) {
308306 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) ;
310308 nb_added += adds;
311309 if adds == 0 && !ty. is_full_generic ( ) {
312310 nb_added += insert ( res, tcx, ty) ;
@@ -319,7 +317,7 @@ crate fn get_real_types<'tcx>(
319317 if let Some ( gens) = arg. generics ( ) {
320318 for gen in gens. iter ( ) {
321319 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) ;
323321 } else {
324322 nb_added += insert ( res, tcx, ( * gen) . clone ( ) ) ;
325323 }
@@ -337,15 +335,14 @@ crate fn get_all_types<'tcx>(
337335 generics : & Generics ,
338336 decl : & FnDecl ,
339337 tcx : TyCtxt < ' tcx > ,
340- cache : & Cache ,
341338) -> ( Vec < ( Type , TypeKind ) > , Vec < ( Type , TypeKind ) > ) {
342339 let mut all_types = FxHashSet :: default ( ) ;
343340 for arg in decl. inputs . values . iter ( ) {
344341 if arg. type_ . is_self_type ( ) {
345342 continue ;
346343 }
347344 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) ;
349346 if !args. is_empty ( ) {
350347 all_types. extend ( args) ;
351348 } else {
@@ -358,7 +355,7 @@ crate fn get_all_types<'tcx>(
358355 let ret_types = match decl. output {
359356 FnRetTy :: Return ( ref return_type) => {
360357 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) ;
362359 if ret. is_empty ( ) {
363360 if let Some ( kind) = return_type. def_id ( ) . map ( |did| tcx. def_kind ( did) . into ( ) ) {
364361 ret. insert ( ( return_type. clone ( ) , kind) ) ;
0 commit comments