@@ -33,7 +33,7 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
3333 desc,
3434 parent : Some ( did) ,
3535 parent_idx : None ,
36- search_type : get_function_type_for_search ( item, tcx) ,
36+ search_type : get_function_type_for_search ( item, tcx, & cache ) ,
3737 aliases : item. attrs . get_doc_aliases ( ) ,
3838 } ) ;
3939 }
@@ -188,11 +188,12 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
188188crate fn get_function_type_for_search < ' tcx > (
189189 item : & clean:: Item ,
190190 tcx : TyCtxt < ' tcx > ,
191+ cache : & Cache ,
191192) -> Option < IndexItemFunctionType > {
192193 let ( mut inputs, mut output) = match * item. kind {
193- clean:: FunctionItem ( ref f) => get_fn_inputs_and_outputs ( f, tcx) ,
194- clean:: MethodItem ( ref m, _) => get_fn_inputs_and_outputs ( m, tcx) ,
195- clean:: TyMethodItem ( ref m) => get_fn_inputs_and_outputs ( m, tcx) ,
194+ clean:: FunctionItem ( ref f) => get_fn_inputs_and_outputs ( f, tcx, cache ) ,
195+ clean:: MethodItem ( ref m, _) => get_fn_inputs_and_outputs ( m, tcx, cache ) ,
196+ clean:: TyMethodItem ( ref m) => get_fn_inputs_and_outputs ( m, tcx, cache ) ,
196197 _ => return None ,
197198 } ;
198199
@@ -311,7 +312,7 @@ fn add_generics_and_bounds_as_types<'tcx>(
311312 // We remove the name of the full generic because we have no use for it.
312313 index_ty. name = Some ( String :: new ( ) ) ;
313314 res. push ( TypeWithKind :: from ( ( index_ty, ItemType :: Generic ) ) ) ;
314- } else if let Some ( kind) = ty. def_id_no_primitives ( ) . map ( |did| tcx. def_kind ( did) . into ( ) ) {
315+ } else if let Some ( kind) = ty. def_id ( cache ) . map ( |did| tcx. def_kind ( did) . into ( ) ) {
315316 res. push ( TypeWithKind :: from ( ( index_ty, kind) ) ) ;
316317 } else if ty. is_primitive ( ) {
317318 // This is a primitive, let's store it as such.
@@ -330,9 +331,7 @@ fn add_generics_and_bounds_as_types<'tcx>(
330331 if let Type :: Generic ( arg_s) = * arg {
331332 // First we check if the bounds are in a `where` predicate...
332333 if let Some ( where_pred) = generics. where_predicates . iter ( ) . find ( |g| match g {
333- WherePredicate :: BoundPredicate { ty, .. } => {
334- ty. def_id_no_primitives ( ) == arg. def_id_no_primitives ( )
335- }
334+ WherePredicate :: BoundPredicate { ty, .. } => ty. def_id ( cache) == arg. def_id ( cache) ,
336335 _ => false ,
337336 } ) {
338337 let mut ty_generics = Vec :: new ( ) ;
@@ -397,6 +396,7 @@ fn add_generics_and_bounds_as_types<'tcx>(
397396fn get_fn_inputs_and_outputs < ' tcx > (
398397 func : & Function ,
399398 tcx : TyCtxt < ' tcx > ,
399+ cache : & Cache ,
400400) -> ( Vec < TypeWithKind > , Vec < TypeWithKind > ) {
401401 let decl = & func. decl ;
402402 let generics = & func. generics ;
@@ -411,8 +411,7 @@ fn get_fn_inputs_and_outputs<'tcx>(
411411 if !args. is_empty ( ) {
412412 all_types. extend ( args) ;
413413 } else {
414- if let Some ( kind) = arg. type_ . def_id_no_primitives ( ) . map ( |did| tcx. def_kind ( did) . into ( ) )
415- {
414+ if let Some ( kind) = arg. type_ . def_id ( cache) . map ( |did| tcx. def_kind ( did) . into ( ) ) {
416415 all_types. push ( TypeWithKind :: from ( ( get_index_type ( & arg. type_ , vec ! [ ] ) , kind) ) ) ;
417416 }
418417 }
@@ -423,9 +422,7 @@ fn get_fn_inputs_and_outputs<'tcx>(
423422 FnRetTy :: Return ( ref return_type) => {
424423 add_generics_and_bounds_as_types ( generics, return_type, tcx, 0 , & mut ret_types) ;
425424 if ret_types. is_empty ( ) {
426- if let Some ( kind) =
427- return_type. def_id_no_primitives ( ) . map ( |did| tcx. def_kind ( did) . into ( ) )
428- {
425+ if let Some ( kind) = return_type. def_id ( cache) . map ( |did| tcx. def_kind ( did) . into ( ) ) {
429426 ret_types. push ( TypeWithKind :: from ( ( get_index_type ( return_type, vec ! [ ] ) , kind) ) ) ;
430427 }
431428 }
0 commit comments