Skip to content

Commit d607e28

Browse files
Rollup merge of rust-lang#34777 - glandium:issue34697, r=GuillaumeGomez
doc: Mention that writeln! and println! always use LF Fixes rust-lang#34697 I'm not really satisfied with the wording, but I didn't have a better idea. Suggestions welcome.
2 parents 257b351 + 4bfaa43 commit d607e28

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: src/libcore/macros.rs

+2
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ macro_rules! write {
238238
}
239239

240240
/// Use the `format!` syntax to write data into a buffer, appending a newline.
241+
/// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`)
242+
/// alone (no additional CARRIAGE RETURN (`\r`/`U+000D`).
241243
///
242244
/// This macro is typically used with a buffer of `&mut `[`Write`][write].
243245
///

Diff for: src/libstd/macros.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ macro_rules! print {
9898
($($arg:tt)*) => ($crate::io::_print(format_args!($($arg)*)));
9999
}
100100

101-
/// Macro for printing to the standard output, with a newline.
101+
/// Macro for printing to the standard output, with a newline. On all
102+
/// platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone
103+
/// (no additional CARRIAGE RETURN (`\r`/`U+000D`).
102104
///
103105
/// Use the `format!` syntax to write data to the standard output.
104106
/// See `std::fmt` for more information.

0 commit comments

Comments
 (0)