File tree 1 file changed +19
-5
lines changed
1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,24 @@ crate fn print_where_clause<'a, 'tcx: 'a>(
262
262
clause. push_str ( " <span class=\" where\" >where" ) ;
263
263
}
264
264
}
265
- for ( i, pred) in gens. where_predicates . iter ( ) . enumerate ( ) {
265
+
266
+ #[ derive( Clone , Copy ) ]
267
+ enum Print < ' a > {
268
+ Predicate ( & ' a clean:: WherePredicate ) ,
269
+ Comma ,
270
+ }
271
+
272
+ for pred in gens. where_predicates . iter ( ) . filter ( |pred| {
273
+ !matches ! ( pred, clean:: WherePredicate :: BoundPredicate { bounds, .. } if bounds. is_empty( ) )
274
+ } ) . map ( Print :: Predicate ) . intersperse ( Print :: Comma ) {
275
+ let pred = match pred {
276
+ Print :: Predicate ( pred) => pred,
277
+ Print :: Comma => {
278
+ clause. push ( ',' ) ;
279
+ continue ;
280
+ }
281
+ } ;
282
+
266
283
if f. alternate ( ) {
267
284
clause. push ( ' ' ) ;
268
285
} else {
@@ -321,13 +338,10 @@ crate fn print_where_clause<'a, 'tcx: 'a>(
321
338
}
322
339
}
323
340
}
324
-
325
- if i < gens. where_predicates . len ( ) - 1 || end_newline {
326
- clause. push ( ',' ) ;
327
- }
328
341
}
329
342
330
343
if end_newline {
344
+ clause. push ( ',' ) ;
331
345
// add a space so stripping <br> tags and breaking spaces still renders properly
332
346
if f. alternate ( ) {
333
347
clause. push ( ' ' ) ;
You can’t perform that action at this time.
0 commit comments