@@ -7,9 +7,7 @@ use rustc_span::symbol::Symbol;
7
7
use serde:: ser:: { Serialize , SerializeStruct , Serializer } ;
8
8
9
9
use crate :: clean;
10
- use crate :: clean:: types:: {
11
- FnRetTy , Function , GenericBound , Generics , ItemId , Type , WherePredicate ,
12
- } ;
10
+ use crate :: clean:: types:: { FnRetTy , Function , Generics , ItemId , Type , WherePredicate } ;
13
11
use crate :: formats:: cache:: { Cache , OrphanImplItem } ;
14
12
use crate :: formats:: item_type:: ItemType ;
15
13
use crate :: html:: format:: join_with_double_colon;
@@ -482,29 +480,23 @@ fn add_generics_and_bounds_as_types<'tcx, 'a>(
482
480
if let Type :: Generic ( arg_s) = * arg {
483
481
// First we check if the bounds are in a `where` predicate...
484
482
if let Some ( where_pred) = generics. where_predicates . iter ( ) . find ( |g| match g {
485
- WherePredicate :: BoundPredicate { ty, .. } => ty . def_id ( cache ) == arg . def_id ( cache ) ,
483
+ WherePredicate :: BoundPredicate { ty : Type :: Generic ( ty_s ) , .. } => * ty_s == arg_s ,
486
484
_ => false ,
487
485
} ) {
488
486
let mut ty_generics = Vec :: new ( ) ;
489
487
let bounds = where_pred. get_bounds ( ) . unwrap_or_else ( || & [ ] ) ;
490
488
for bound in bounds. iter ( ) {
491
- if let GenericBound :: TraitBound ( poly_trait, _) = bound {
492
- for param_def in poly_trait. generic_params . iter ( ) {
493
- match & param_def. kind {
494
- clean:: GenericParamDefKind :: Type { default : Some ( ty) , .. } => {
495
- add_generics_and_bounds_as_types (
496
- self_,
497
- generics,
498
- ty,
499
- tcx,
500
- recurse + 1 ,
501
- & mut ty_generics,
502
- cache,
503
- )
504
- }
505
- _ => { }
506
- }
507
- }
489
+ if let Some ( path) = bound. get_trait_path ( ) {
490
+ let ty = Type :: Path { path } ;
491
+ add_generics_and_bounds_as_types (
492
+ self_,
493
+ generics,
494
+ & ty,
495
+ tcx,
496
+ recurse + 1 ,
497
+ & mut ty_generics,
498
+ cache,
499
+ ) ;
508
500
}
509
501
}
510
502
insert_ty ( res, arg. clone ( ) , ty_generics) ;
0 commit comments