From fbce952193d38328c39262cf2fb7f7bfbe088a70 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Sun, 15 Jul 2018 11:52:11 -0700 Subject: review comments: modify note wording and change `println` - Don't print the newline on its own to avoid the possibility of printing it out of order due to `stdout` locking. - Modify wording of `concat!()` with non-literals to not mislead into believing that only `&str` literals are accepted. - Add test for `concat!()` with non-literals. --- src/libstd/macros.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index a4a6ed73c61..7f3c8fcdd5a 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -155,14 +155,7 @@ macro_rules! print { #[stable(feature = "rust1", since = "1.0.0")] macro_rules! println { () => (print!("\n")); - ($fmt:expr) => ({ - print!($fmt); - print!("\n"); - }); - ($fmt:expr, $($arg:tt)*) => ({ - print!($fmt, $($arg)*); - print!("\n"); - }); + ($($arg:tt)*) => (print!("{}\n", format_args!($($arg)*))); } /// Macro for printing to the standard error. -- cgit 1.4.1-3-g733a5