@@ -257,7 +257,7 @@ crate fn get_real_types<'tcx>(
257
257
tcx : TyCtxt < ' _ > ,
258
258
ty : Type ,
259
259
mut generics : Vec < TypeWithKind > ,
260
- cache : & Cache ,
260
+ _cache : & Cache ,
261
261
) {
262
262
let is_full_generic = ty. is_full_generic ( ) ;
263
263
@@ -309,7 +309,7 @@ crate fn get_real_types<'tcx>(
309
309
// We remove the name of the full generic because we have no use for it.
310
310
index_ty. name = Some ( String :: new ( ) ) ;
311
311
res. push ( TypeWithKind :: from ( ( index_ty, ItemType :: Generic ) ) ) ;
312
- } else if let Some ( kind) = ty. def_id ( cache ) . map ( |did| tcx. def_kind ( did) . into ( ) ) {
312
+ } else if let Some ( kind) = ty. def_id_no_primitives ( ) . map ( |did| tcx. def_kind ( did) . into ( ) ) {
313
313
res. push ( TypeWithKind :: from ( ( index_ty, kind) ) ) ;
314
314
} else if ty. is_primitive ( ) {
315
315
// This is a primitive, let's store it as such.
@@ -324,7 +324,9 @@ crate fn get_real_types<'tcx>(
324
324
325
325
if let Type :: Generic ( arg_s) = * arg {
326
326
if let Some ( where_pred) = generics. where_predicates . iter ( ) . find ( |g| match g {
327
- WherePredicate :: BoundPredicate { ty, .. } => ty. def_id ( cache) == arg. def_id ( cache) ,
327
+ WherePredicate :: BoundPredicate { ty, .. } => {
328
+ ty. def_id_no_primitives ( ) == arg. def_id_no_primitives ( )
329
+ }
328
330
_ => false ,
329
331
} ) {
330
332
let mut ty_generics = Vec :: new ( ) ;
@@ -395,7 +397,8 @@ crate fn get_all_types<'tcx>(
395
397
// `all_types.extend(args.drain(..));`.
396
398
all_types. extend ( args) ;
397
399
} else {
398
- if let Some ( kind) = arg. type_ . def_id ( cache) . map ( |did| tcx. def_kind ( did) . into ( ) ) {
400
+ if let Some ( kind) = arg. type_ . def_id_no_primitives ( ) . map ( |did| tcx. def_kind ( did) . into ( ) )
401
+ {
399
402
all_types. push ( TypeWithKind :: from ( ( get_index_type ( & arg. type_ , vec ! [ ] ) , kind) ) ) ;
400
403
}
401
404
}
@@ -406,7 +409,9 @@ crate fn get_all_types<'tcx>(
406
409
FnRetTy :: Return ( ref return_type) => {
407
410
get_real_types ( generics, return_type, tcx, 0 , & mut ret_types, cache) ;
408
411
if ret_types. is_empty ( ) {
409
- if let Some ( kind) = return_type. def_id ( cache) . map ( |did| tcx. def_kind ( did) . into ( ) ) {
412
+ if let Some ( kind) =
413
+ return_type. def_id_no_primitives ( ) . map ( |did| tcx. def_kind ( did) . into ( ) )
414
+ {
410
415
ret_types. push ( TypeWithKind :: from ( ( get_index_type ( return_type, vec ! [ ] ) , kind) ) ) ;
411
416
}
412
417
}
0 commit comments