Fix pretty printing of empty type bound lists in where-clause

This commit is contained in:
David Tolnay 2022-06-16 17:14:51 -07:00
parent 1b8ca54002
commit fe9635f7c0
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
3 changed files with 76 additions and 50 deletions

View file

@ -1355,7 +1355,10 @@ impl<'a> Parser<'a> {
s.print_mutability(mut_ty.mutbl, false);
s.popen();
s.print_type(&mut_ty.ty);
s.print_type_bounds(" +", &bounds);
if !bounds.is_empty() {
s.word(" + ");
s.print_type_bounds(&bounds);
}
s.pclose()
});