Skip to content

Commit 5ea8d7f

Browse files
committed
Make the pretty printer put trailing newlines at the end of files.
1 parent 9bfbb2b commit 5ea8d7f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/comp/syntax/print/pprust.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,6 +1368,9 @@ fn maybe_print_trailing_comment(s: &ps, span: codemap::span,
13681368
}
13691369

13701370
fn print_remaining_comments(s: &ps) {
1371+
// If there aren't any remaining comments, then we need to manually
1372+
// make sure there is a line break at the end.
1373+
if option::is_none(next_comment(s)) { hardbreak(s.s); }
13711374
while true {
13721375
alt next_comment(s) {
13731376
some(cmnt) { print_comment(s, cmnt); s.cur_cmnt += 1u; }

0 commit comments

Comments
 (0)