@@ -138,36 +138,37 @@ impl Clean<Path> for ty::TraitRef<'tcx> {
138
138
}
139
139
}
140
140
141
- impl Clean < GenericBound > for ( ty:: PolyTraitRef < ' _ > , & [ TypeBinding ] ) {
142
- fn clean ( & self , cx : & mut DocContext < ' _ > ) -> GenericBound {
143
- let ( poly_trait_ref, bindings) = * self ;
144
- let poly_trait_ref = poly_trait_ref. lift_to_tcx ( cx. tcx ) . unwrap ( ) ;
145
-
146
- // collect any late bound regions
147
- let late_bound_regions: Vec < _ > = cx
148
- . tcx
149
- . collect_referenced_late_bound_regions ( & poly_trait_ref)
150
- . into_iter ( )
151
- . filter_map ( |br| match br {
152
- ty:: BrNamed ( _, name) => Some ( GenericParamDef {
153
- name,
154
- kind : GenericParamDefKind :: Lifetime { outlives : vec ! [ ] } ,
155
- } ) ,
156
- _ => None ,
157
- } )
158
- . collect ( ) ;
141
+ fn clean_poly_trait_ref_with_bindings (
142
+ cx : & mut DocContext < ' _ > ,
143
+ poly_trait_ref : ty:: PolyTraitRef < ' _ > ,
144
+ bindings : & [ TypeBinding ] ,
145
+ ) -> GenericBound {
146
+ let poly_trait_ref = poly_trait_ref. lift_to_tcx ( cx. tcx ) . unwrap ( ) ;
147
+
148
+ // collect any late bound regions
149
+ let late_bound_regions: Vec < _ > = cx
150
+ . tcx
151
+ . collect_referenced_late_bound_regions ( & poly_trait_ref)
152
+ . into_iter ( )
153
+ . filter_map ( |br| match br {
154
+ ty:: BrNamed ( _, name) => Some ( GenericParamDef {
155
+ name,
156
+ kind : GenericParamDefKind :: Lifetime { outlives : vec ! [ ] } ,
157
+ } ) ,
158
+ _ => None ,
159
+ } )
160
+ . collect ( ) ;
159
161
160
- let trait_ = clean_trait_ref_with_bindings ( cx, poly_trait_ref. skip_binder ( ) , bindings) ;
161
- GenericBound :: TraitBound (
162
- PolyTrait { trait_, generic_params : late_bound_regions } ,
163
- hir:: TraitBoundModifier :: None ,
164
- )
165
- }
162
+ let trait_ = clean_trait_ref_with_bindings ( cx, poly_trait_ref. skip_binder ( ) , bindings) ;
163
+ GenericBound :: TraitBound (
164
+ PolyTrait { trait_, generic_params : late_bound_regions } ,
165
+ hir:: TraitBoundModifier :: None ,
166
+ )
166
167
}
167
168
168
169
impl < ' tcx > Clean < GenericBound > for ty:: PolyTraitRef < ' tcx > {
169
170
fn clean ( & self , cx : & mut DocContext < ' _ > ) -> GenericBound {
170
- ( * self , & [ ] [ .. ] ) . clean ( cx )
171
+ clean_poly_trait_ref_with_bindings ( cx , * self , & [ ] )
171
172
}
172
173
}
173
174
@@ -1513,7 +1514,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
1513
1514
}
1514
1515
}
1515
1516
1516
- let bounds : Vec < _ > = bounds
1517
+ let bindings : Vec < _ > = bounds
1517
1518
. iter ( )
1518
1519
. filter_map ( |bound| {
1519
1520
if let ty:: PredicateKind :: Projection ( proj) =
@@ -1541,7 +1542,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
1541
1542
} )
1542
1543
. collect ( ) ;
1543
1544
1544
- Some ( ( trait_ref, & bounds [ .. ] ) . clean ( cx ) )
1545
+ Some ( clean_poly_trait_ref_with_bindings ( cx , trait_ref, & bindings ) )
1545
1546
} )
1546
1547
. collect :: < Vec < _ > > ( ) ;
1547
1548
bounds. extend ( regions) ;
0 commit comments