@@ -533,7 +533,8 @@ impl Clean<Generics> for hir::Generics<'_> {
533
533
match param. kind {
534
534
GenericParamDefKind :: Lifetime => unreachable ! ( ) ,
535
535
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 ( ) ) ;
537
538
}
538
539
GenericParamDefKind :: Const { .. } => unreachable ! ( ) ,
539
540
}
@@ -614,7 +615,7 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics, ty::GenericPredicates<'tcx
614
615
. collect :: < Vec < GenericParamDef > > ( ) ;
615
616
616
617
// 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 ( ) ;
618
619
619
620
let where_predicates = preds
620
621
. predicates
@@ -663,10 +664,11 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics, ty::GenericPredicates<'tcx
663
664
if let Some ( ( ( _, trait_did, name) , rhs) ) =
664
665
proj. as_ref ( ) . and_then ( |( lhs, rhs) | Some ( ( lhs. projection ( ) ?, rhs) ) )
665
666
{
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
+ ) ) ;
670
672
}
671
673
672
674
return None ;
@@ -685,7 +687,13 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics, ty::GenericPredicates<'tcx
685
687
if let Some ( proj) = impl_trait_proj. remove ( & idx) {
686
688
for ( trait_did, name, rhs) in proj {
687
689
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
+ ) ;
689
697
}
690
698
}
691
699
} else {
@@ -1175,7 +1183,8 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
1175
1183
if let Some ( new_ty) = cx. ty_substs . get ( & did) . cloned ( ) {
1176
1184
return new_ty;
1177
1185
}
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
+ {
1179
1188
return ImplTrait ( bounds) ;
1180
1189
}
1181
1190
}
@@ -2006,7 +2015,7 @@ fn clean_extern_crate(
2006
2015
vec ! [ Item {
2007
2016
name: Some ( name) ,
2008
2017
attrs: box attrs. clean( cx) ,
2009
- def_id: crate_def_id,
2018
+ def_id: crate_def_id. into ( ) ,
2010
2019
visibility: krate. vis. clean( cx) ,
2011
2020
kind: box ExternCrateItem { src: orig_name } ,
2012
2021
cfg: attrs. cfg( cx. sess( ) . diagnostic( ) ) ,
0 commit comments