about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-10-21 02:26:24 -0700
committerbors <bors@rust-lang.org>2013-10-21 02:26:24 -0700
commit04ac697f529136abec5e6e7cc888fef1afbf1c4b (patch)
tree4d07ae02729636632a4260a86d59d980493eb597 /src/libsyntax
parentcd59a7c464811e164f3a1c87d8fa31fdaa5fbafa (diff)
parentdf6225b8c3c981a686e5590dc59a7a5865476862 (diff)
downloadrust-04ac697f529136abec5e6e7cc888fef1afbf1c4b.tar.gz
rust-04ac697f529136abec5e6e7cc888fef1afbf1c4b.zip
auto merge of #9979 : alexcrichton/rust/print-no-alloc, r=huonw
Instead use format_args! to pass around a struct to pass along into std::fmt
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/expand.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index bc91283b47b..620594a0a17 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -999,16 +999,11 @@ pub fn std_macros() -> @str {
     macro_rules! writeln(($dst:expr, $($arg:tt)*) => (
         format_args!(|args| { ::std::fmt::writeln($dst, args) }, $($arg)*)
     ))
-    // FIXME(#6846) once stdio is redesigned, this shouldn't perform an
-    //              allocation but should rather delegate to an invocation of
-    //              write! instead of format!
     macro_rules! print (
-        ($($arg:tt)*) => (::std::io::print(format!($($arg)*)))
+        ($($arg:tt)*) => (format_args!(::std::rt::io::stdio::print_args, $($arg)*))
     )
-    // FIXME(#6846) once stdio is redesigned, this shouldn't perform an
-    //              allocation but should rather delegate to an io::Writer
     macro_rules! println (
-        ($($arg:tt)*) => (::std::io::println(format!($($arg)*)))
+        ($($arg:tt)*) => (format_args!(::std::rt::io::stdio::println_args, $($arg)*))
     )
 
     macro_rules! local_data_key (