summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2022-04-26 15:16:23 -0700
committerDavid Tolnay <dtolnay@gmail.com>2022-04-27 13:22:41 -0700
commit3a8f81aac94ccb4051410232e4f39b89ed6dae4e (patch)
treec0e6d0536e8ffdce4fb29c8494beb5d111be0775 /library/std/src
parent69a5d2481e856a5a18885390b8cf6950b9ff8dd3 (diff)
downloadrust-3a8f81aac94ccb4051410232e4f39b89ed6dae4e.tar.gz
rust-3a8f81aac94ccb4051410232e4f39b89ed6dae4e.zip
Make [e]println macros eagerly drop temporaries (for backport)
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/macros.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs
index c597fb5df45..732acaa4186 100644
--- a/library/std/src/macros.rs
+++ b/library/std/src/macros.rs
@@ -99,9 +99,9 @@ macro_rules! println {
     () => {
         $crate::print!("\n")
     };
-    ($($arg:tt)*) => {
-        $crate::io::_print($crate::format_args_nl!($($arg)*))
-    };
+    ($($arg:tt)*) => {{
+        $crate::io::_print($crate::format_args_nl!($($arg)*));
+    }};
 }
 
 /// Prints to the standard error.
@@ -164,9 +164,9 @@ macro_rules! eprintln {
     () => {
         $crate::eprint!("\n")
     };
-    ($($arg:tt)*) => {
-        $crate::io::_eprint($crate::format_args_nl!($($arg)*))
-    };
+    ($($arg:tt)*) => {{
+        $crate::io::_eprint($crate::format_args_nl!($($arg)*));
+    }};
 }
 
 /// Prints and returns the value of a given expression for quick and dirty