@@ -418,9 +418,11 @@ impl<'tcx> Clean<Type> for ty::ProjectionTy<'tcx> {
418
418
GenericBound :: TraitBound ( t, _) => t. trait_ ,
419
419
GenericBound :: Outlives ( _) => panic ! ( "cleaning a trait got a lifetime" ) ,
420
420
} ;
421
+ let self_type = self . self_ty ( ) . clean ( cx) ;
421
422
Type :: QPath {
422
423
name : cx. tcx . associated_item ( self . item_def_id ) . ident . name ,
423
- self_type : box self . self_ty ( ) . clean ( cx) ,
424
+ self_def_id : self_type. def_id ( ) ,
425
+ self_type : box self_type,
424
426
trait_ : box trait_,
425
427
}
426
428
}
@@ -1104,7 +1106,7 @@ impl Clean<Item> for ty::AssocItem {
1104
1106
. filter_map ( |pred| {
1105
1107
let ( name, self_type, trait_, bounds) = match * pred {
1106
1108
WherePredicate :: BoundPredicate {
1107
- ty : QPath { ref name, ref self_type, ref trait_ } ,
1109
+ ty : QPath { ref name, ref self_type, ref trait_, .. } ,
1108
1110
ref bounds,
1109
1111
} => ( name, self_type, trait_, bounds) ,
1110
1112
_ => return None ,
@@ -1282,16 +1284,15 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
1282
1284
1283
1285
let segments = if p. is_global ( ) { & p. segments [ 1 ..] } else { & p. segments } ;
1284
1286
let trait_segments = & segments[ ..segments. len ( ) - 1 ] ;
1287
+ let trait_def = cx. tcx . associated_item ( p. res . def_id ( ) ) . container . id ( ) ;
1285
1288
let trait_path = self :: Path {
1286
1289
global : p. is_global ( ) ,
1287
- res : Res :: Def (
1288
- DefKind :: Trait ,
1289
- cx. tcx . associated_item ( p. res . def_id ( ) ) . container . id ( ) ,
1290
- ) ,
1290
+ res : Res :: Def ( DefKind :: Trait , trait_def) ,
1291
1291
segments : trait_segments. clean ( cx) ,
1292
1292
} ;
1293
1293
Type :: QPath {
1294
1294
name : p. segments . last ( ) . expect ( "segments were empty" ) . ident . name ,
1295
+ self_def_id : Some ( DefId :: local ( qself. hir_id . owner . local_def_index ) ) ,
1295
1296
self_type : box qself. clean ( cx) ,
1296
1297
trait_ : box resolve_type ( cx, trait_path, hir_id) ,
1297
1298
}
@@ -1306,6 +1307,7 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
1306
1307
let trait_path = hir:: Path { span, res, segments : & [ ] } . clean ( cx) ;
1307
1308
Type :: QPath {
1308
1309
name : segment. ident . name ,
1310
+ self_def_id : res. opt_def_id ( ) ,
1309
1311
self_type : box qself. clean ( cx) ,
1310
1312
trait_ : box resolve_type ( cx, trait_path, hir_id) ,
1311
1313
}
0 commit comments