@@ -418,9 +418,11 @@ impl<'tcx> Clean<Type> for ty::ProjectionTy<'tcx> {
418418 GenericBound :: TraitBound ( t, _) => t. trait_ ,
419419 GenericBound :: Outlives ( _) => panic ! ( "cleaning a trait got a lifetime" ) ,
420420 } ;
421+ let self_type = self . self_ty ( ) . clean ( cx) ;
421422 Type :: QPath {
422423 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,
424426 trait_ : box trait_,
425427 }
426428 }
@@ -1104,7 +1106,7 @@ impl Clean<Item> for ty::AssocItem {
11041106 . filter_map ( |pred| {
11051107 let ( name, self_type, trait_, bounds) = match * pred {
11061108 WherePredicate :: BoundPredicate {
1107- ty : QPath { ref name, ref self_type, ref trait_ } ,
1109+ ty : QPath { ref name, ref self_type, ref trait_, .. } ,
11081110 ref bounds,
11091111 } => ( name, self_type, trait_, bounds) ,
11101112 _ => return None ,
@@ -1282,16 +1284,15 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
12821284
12831285 let segments = if p. is_global ( ) { & p. segments [ 1 ..] } else { & p. segments } ;
12841286 let trait_segments = & segments[ ..segments. len ( ) - 1 ] ;
1287+ let trait_def = cx. tcx . associated_item ( p. res . def_id ( ) ) . container . id ( ) ;
12851288 let trait_path = self :: Path {
12861289 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) ,
12911291 segments : trait_segments. clean ( cx) ,
12921292 } ;
12931293 Type :: QPath {
12941294 name : p. segments . last ( ) . expect ( "segments were empty" ) . ident . name ,
1295+ self_def_id : Some ( DefId :: local ( qself. hir_id . owner . local_def_index ) ) ,
12951296 self_type : box qself. clean ( cx) ,
12961297 trait_ : box resolve_type ( cx, trait_path, hir_id) ,
12971298 }
@@ -1306,6 +1307,7 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
13061307 let trait_path = hir:: Path { span, res, segments : & [ ] } . clean ( cx) ;
13071308 Type :: QPath {
13081309 name : segment. ident . name ,
1310+ self_def_id : res. opt_def_id ( ) ,
13091311 self_type : box qself. clean ( cx) ,
13101312 trait_ : box resolve_type ( cx, trait_path, hir_id) ,
13111313 }
0 commit comments