@@ -41,7 +41,7 @@ use std::hash::Hash;
4141use std:: mem;
4242use thin_vec:: ThinVec ;
4343
44- use crate :: core:: { self , DocContext , ImplTraitParam } ;
44+ use crate :: core:: { self , DocContext } ;
4545use crate :: formats:: item_type:: ItemType ;
4646use crate :: visit_ast:: Module as DocModule ;
4747
@@ -761,7 +761,7 @@ fn clean_ty_generics<'tcx>(
761761) -> Generics {
762762 // Don't populate `cx.impl_trait_bounds` before `clean`ning `where` clauses,
763763 // 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 ( ) ;
765765
766766 // Bounds in the type_params and lifetimes fields are repeated in the
767767 // predicates field (see rustc_hir_analysis::collect::ty_generics), so remove
@@ -778,7 +778,7 @@ fn clean_ty_generics<'tcx>(
778778 return None ;
779779 }
780780 if synthetic {
781- impl_trait. insert ( param. index . into ( ) , vec ! [ ] ) ;
781+ impl_trait. insert ( param. index , vec ! [ ] ) ;
782782 return None ;
783783 }
784784 Some ( clean_generic_param_def ( param, cx) )
@@ -823,7 +823,7 @@ fn clean_ty_generics<'tcx>(
823823 } ) ( ) ;
824824
825825 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)
827827 {
828828 let pred = clean_predicate ( * pred, cx) ?;
829829
@@ -847,7 +847,7 @@ fn clean_ty_generics<'tcx>(
847847 } )
848848 . collect :: < Vec < _ > > ( ) ;
849849
850- for ( param , mut bounds) in impl_trait {
850+ for ( idx , mut bounds) in impl_trait {
851851 let mut has_sized = false ;
852852 bounds. retain ( |b| {
853853 if b. is_sized_bound ( cx) {
@@ -870,15 +870,14 @@ fn clean_ty_generics<'tcx>(
870870 bounds. insert ( 0 , GenericBound :: sized ( cx) ) ;
871871 }
872872
873- let crate :: core:: ImplTraitParam :: ParamIndex ( idx) = param else { unreachable ! ( ) } ;
874873 if let Some ( proj) = impl_trait_proj. remove ( & idx) {
875874 for ( trait_did, name, rhs) in proj {
876875 let rhs = clean_middle_term ( rhs, cx) ;
877876 simplify:: merge_bounds ( cx, & mut bounds, trait_did, name, & rhs) ;
878877 }
879878 }
880879
881- cx. impl_trait_bounds . insert ( param , bounds) ;
880+ cx. impl_trait_bounds . insert ( idx . into ( ) , bounds) ;
882881 }
883882
884883 // Now that `cx.impl_trait_bounds` is populated, we can process
0 commit comments