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 @@ -279,7 +279,24 @@ crate fn print_where_clause<'a, 'tcx: 'a>(
279
279
clause. push_str ( " <span class=\" where\" >where" ) ;
280
280
}
281
281
}
282
- for ( i, pred) in gens. where_predicates . iter ( ) . enumerate ( ) {
282
+
283
+ #[ derive( Clone , Copy ) ]
284
+ enum Print < ' a > {
285
+ Predicate ( & ' a clean:: WherePredicate ) ,
286
+ Comma ,
287
+ }
288
+
289
+ for pred in gens. where_predicates . iter ( ) . filter ( |pred| {
290
+ !matches ! ( pred, clean:: WherePredicate :: BoundPredicate { bounds, .. } if bounds. is_empty( ) )
291
+ } ) . map ( Print :: Predicate ) . intersperse ( Print :: Comma ) {
292
+ let pred = match pred {
293
+ Print :: Predicate ( pred) => pred,
294
+ Print :: Comma => {
295
+ clause. push ( ',' ) ;
296
+ continue ;
297
+ }
298
+ } ;
299
+
283
300
if f. alternate ( ) {
284
301
clause. push ( ' ' ) ;
285
302
} else {
@@ -338,13 +355,10 @@ crate fn print_where_clause<'a, 'tcx: 'a>(
338
355
}
339
356
}
340
357
}
341
-
342
- if i < gens. where_predicates . len ( ) - 1 || end_newline {
343
- clause. push ( ',' ) ;
344
- }
345
358
}
346
359
347
360
if end_newline {
361
+ clause. push ( ',' ) ;
348
362
// add a space so stripping <br> tags and breaking spaces still renders properly
349
363
if f. alternate ( ) {
350
364
clause. push ( ' ' ) ;
You can’t perform that action at this time.
0 commit comments