@@ -533,7 +533,8 @@ impl Clean<Generics> for hir::Generics<'_> {
533533 match param. kind {
534534 GenericParamDefKind :: Lifetime => unreachable ! ( ) ,
535535 GenericParamDefKind :: Type { did, ref bounds, .. } => {
536- cx. impl_trait_bounds . insert ( did. into ( ) , bounds. clone ( ) ) ;
536+ cx. impl_trait_bounds
537+ . insert ( FakeDefId :: new_real ( did) . into ( ) , bounds. clone ( ) ) ;
537538 }
538539 GenericParamDefKind :: Const { .. } => unreachable ! ( ) ,
539540 }
@@ -614,7 +615,7 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics, ty::GenericPredicates<'tcx
614615 . collect :: < Vec < GenericParamDef > > ( ) ;
615616
616617 // param index -> [(DefId of trait, associated type name, type)]
617- let mut impl_trait_proj = FxHashMap :: < u32 , Vec < ( DefId , Symbol , Ty < ' tcx > ) > > :: default ( ) ;
618+ let mut impl_trait_proj = FxHashMap :: < u32 , Vec < ( FakeDefId , Symbol , Ty < ' tcx > ) > > :: default ( ) ;
618619
619620 let where_predicates = preds
620621 . predicates
@@ -663,10 +664,11 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics, ty::GenericPredicates<'tcx
663664 if let Some ( ( ( _, trait_did, name) , rhs) ) =
664665 proj. as_ref ( ) . and_then ( |( lhs, rhs) | Some ( ( lhs. projection ( ) ?, rhs) ) )
665666 {
666- impl_trait_proj
667- . entry ( param_idx)
668- . or_default ( )
669- . push ( ( trait_did, name, rhs) ) ;
667+ impl_trait_proj. entry ( param_idx) . or_default ( ) . push ( (
668+ trait_did. into ( ) ,
669+ name,
670+ rhs,
671+ ) ) ;
670672 }
671673
672674 return None ;
@@ -685,7 +687,13 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics, ty::GenericPredicates<'tcx
685687 if let Some ( proj) = impl_trait_proj. remove ( & idx) {
686688 for ( trait_did, name, rhs) in proj {
687689 let rhs = rhs. clean ( cx) ;
688- simplify:: merge_bounds ( cx, & mut bounds, trait_did, name, & rhs) ;
690+ simplify:: merge_bounds (
691+ cx,
692+ & mut bounds,
693+ trait_did. expect_real ( ) ,
694+ name,
695+ & rhs,
696+ ) ;
689697 }
690698 }
691699 } else {
@@ -1175,7 +1183,8 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
11751183 if let Some ( new_ty) = cx. ty_substs . get ( & did) . cloned ( ) {
11761184 return new_ty;
11771185 }
1178- if let Some ( bounds) = cx. impl_trait_bounds . remove ( & did. into ( ) ) {
1186+ if let Some ( bounds) = cx. impl_trait_bounds . remove ( & FakeDefId :: new_real ( did) . into ( ) )
1187+ {
11791188 return ImplTrait ( bounds) ;
11801189 }
11811190 }
@@ -2006,7 +2015,7 @@ fn clean_extern_crate(
20062015 vec ! [ Item {
20072016 name: Some ( name) ,
20082017 attrs: box attrs. clean( cx) ,
2009- def_id: crate_def_id,
2018+ def_id: crate_def_id. into ( ) ,
20102019 visibility: krate. vis. clean( cx) ,
20112020 kind: box ExternCrateItem { src: orig_name } ,
20122021 cfg: attrs. cfg( cx. sess( ) . diagnostic( ) ) ,
0 commit comments