File tree Expand file tree Collapse file tree 4 files changed +26
-3
lines changed Expand file tree Collapse file tree 4 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 84fb821e4036a65f78db1821d75b95526ed3fd76
2
+ refs/heads/master: b02f1f46e550e8f87df6c3ec7f9721b1f4edc958
Original file line number Diff line number Diff line change @@ -1537,7 +1537,12 @@ fn print_comment(s: &ps, cmnt: lexer::cmnt) {
1537
1537
}
1538
1538
lexer:: isolated. {
1539
1539
pprust:: hardbreak_if_not_bol ( s) ;
1540
- for line: str in cmnt. lines { word ( s. s , line) ; hardbreak ( s. s ) ; }
1540
+ for line: str in cmnt. lines {
1541
+ // Don't print empty lines because they will end up as trailing
1542
+ // whitespace
1543
+ if str:: is_not_empty ( line) { word ( s. s , line) ; }
1544
+ hardbreak ( s. s ) ;
1545
+ }
1541
1546
}
1542
1547
lexer:: trailing. {
1543
1548
word ( s. s , " " ) ;
@@ -1546,7 +1551,10 @@ fn print_comment(s: &ps, cmnt: lexer::cmnt) {
1546
1551
hardbreak ( s. s ) ;
1547
1552
} else {
1548
1553
ibox ( s, 0 u) ;
1549
- for line: str in cmnt. lines { word ( s. s , line) ; hardbreak ( s. s ) ; }
1554
+ for line: str in cmnt. lines {
1555
+ if str:: is_not_empty ( line) { word ( s. s , line) ; }
1556
+ hardbreak ( s. s ) ;
1557
+ }
1550
1558
end ( s) ;
1551
1559
}
1552
1560
}
Original file line number Diff line number Diff line change
1
+ // pp-exact
2
+ fn f ( ) {
3
+ /*
4
+ The next line should not be indented.
5
+
6
+ That one. It shouldn't have been indented.
7
+ */
8
+ }
Original file line number Diff line number Diff line change
1
+ // pp-exact
2
+ fn f ( ) {
3
+ } /*
4
+ The next line should not be indented.
5
+
6
+ That one. It shouldn't have been indented.
7
+ */
You can’t perform that action at this time.
0 commit comments