Skip to content

Commit a025675

Browse files
committed
Auto merge of #24696 - tamird:windows-newline, r=alexcrichton
2 parents 2a62242 + bad285c commit a025675

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: src/libsyntax/print/pp.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,14 @@ impl<'a> Printer<'a> {
508508
}
509509
pub fn print_newline(&mut self, amount: isize) -> io::Result<()> {
510510
debug!("NEWLINE {}", amount);
511-
let ret = write!(self.out, "\n");
511+
let ret = if cfg!(windows) {
512+
self.out.write_all(b"\r\n")
513+
} else {
514+
self.out.write_all(b"\n")
515+
};
512516
self.pending_indentation = 0;
513517
self.indent(amount);
514-
return ret;
518+
ret
515519
}
516520
pub fn indent(&mut self, amount: isize) {
517521
debug!("INDENT {}", amount);

0 commit comments

Comments
 (0)