@@ -41,7 +41,7 @@ use std::hash::Hash;
41
41
use std:: mem;
42
42
use thin_vec:: ThinVec ;
43
43
44
- use crate :: core:: { self , DocContext , ImplTraitParam } ;
44
+ use crate :: core:: { self , DocContext } ;
45
45
use crate :: formats:: item_type:: ItemType ;
46
46
use crate :: visit_ast:: Module as DocModule ;
47
47
@@ -761,7 +761,7 @@ fn clean_ty_generics<'tcx>(
761
761
) -> Generics {
762
762
// Don't populate `cx.impl_trait_bounds` before `clean`ning `where` clauses,
763
763
// since `Clean for ty::Predicate` would consume them.
764
- let mut impl_trait = BTreeMap :: < ImplTraitParam , Vec < GenericBound > > :: default ( ) ;
764
+ let mut impl_trait = BTreeMap :: < u32 , Vec < GenericBound > > :: default ( ) ;
765
765
766
766
// Bounds in the type_params and lifetimes fields are repeated in the
767
767
// predicates field (see rustc_hir_analysis::collect::ty_generics), so remove
@@ -778,7 +778,7 @@ fn clean_ty_generics<'tcx>(
778
778
return None ;
779
779
}
780
780
if synthetic {
781
- impl_trait. insert ( param. index . into ( ) , vec ! [ ] ) ;
781
+ impl_trait. insert ( param. index , vec ! [ ] ) ;
782
782
return None ;
783
783
}
784
784
Some ( clean_generic_param_def ( param, cx) )
@@ -823,7 +823,7 @@ fn clean_ty_generics<'tcx>(
823
823
} ) ( ) ;
824
824
825
825
if let Some ( param_idx) = param_idx
826
- && let Some ( bounds) = impl_trait. get_mut ( & param_idx. into ( ) )
826
+ && let Some ( bounds) = impl_trait. get_mut ( & param_idx)
827
827
{
828
828
let pred = clean_predicate ( * pred, cx) ?;
829
829
@@ -847,7 +847,7 @@ fn clean_ty_generics<'tcx>(
847
847
} )
848
848
. collect :: < Vec < _ > > ( ) ;
849
849
850
- for ( param , mut bounds) in impl_trait {
850
+ for ( idx , mut bounds) in impl_trait {
851
851
let mut has_sized = false ;
852
852
bounds. retain ( |b| {
853
853
if b. is_sized_bound ( cx) {
@@ -870,15 +870,14 @@ fn clean_ty_generics<'tcx>(
870
870
bounds. insert ( 0 , GenericBound :: sized ( cx) ) ;
871
871
}
872
872
873
- let crate :: core:: ImplTraitParam :: ParamIndex ( idx) = param else { unreachable ! ( ) } ;
874
873
if let Some ( proj) = impl_trait_proj. remove ( & idx) {
875
874
for ( trait_did, name, rhs) in proj {
876
875
let rhs = clean_middle_term ( rhs, cx) ;
877
876
simplify:: merge_bounds ( cx, & mut bounds, trait_did, name, & rhs) ;
878
877
}
879
878
}
880
879
881
- cx. impl_trait_bounds . insert ( param , bounds) ;
880
+ cx. impl_trait_bounds . insert ( idx . into ( ) , bounds) ;
882
881
}
883
882
884
883
// Now that `cx.impl_trait_bounds` is populated, we can process
0 commit comments