about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2016-07-12 14:37:04 +0900
committerMike Hommey <mh@glandium.org>2016-07-12 14:39:16 +0900
commit4bfaa43eed7ea88fa581c875f5d1c1c801d64e5f (patch)
treeda310077733e2cb410c4c450be9e1fb3ee427ba5
parent3265bd54b5b3f32d038273afec7554f007a5ce1d (diff)
downloadrust-4bfaa43eed7ea88fa581c875f5d1c1c801d64e5f.tar.gz
rust-4bfaa43eed7ea88fa581c875f5d1c1c801d64e5f.zip
doc: Mention that writeln! and println! always use LF
Fixes #34697
-rw-r--r--src/libcore/macros.rs2
-rw-r--r--src/libstd/macros.rs4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index 376d2792c44..43868d124a2 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -238,6 +238,8 @@ macro_rules! write {
 }
 
 /// Use the `format!` syntax to write data into a buffer, appending a newline.
+/// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`)
+/// alone (no additional CARRIAGE RETURN (`\r`/`U+000D`).
 ///
 /// This macro is typically used with a buffer of `&mut `[`Write`][write].
 ///
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index 26cf8a3199d..6f0f6ecab5b 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -98,7 +98,9 @@ macro_rules! print {
     ($($arg:tt)*) => ($crate::io::_print(format_args!($($arg)*)));
 }
 
-/// Macro for printing to the standard output, with a newline.
+/// Macro for printing to the standard output, with a newline. On all
+/// platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone
+/// (no additional CARRIAGE RETURN (`\r`/`U+000D`).
 ///
 /// Use the `format!` syntax to write data to the standard output.
 /// See `std::fmt` for more information.