diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-08-23 18:14:11 -0700 | 
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-08-24 12:48:10 -0700 | 
| commit | eb836dd61ed2d780ca9639f73876c3d3e05ef079 (patch) | |
| tree | eaf2ec2ed5b7ab0087f33b3199f04f04e7cf2e68 /src/libsyntax/ext/expand.rs | |
| parent | 67512f717e7592d347fc825d2917b786a19b78bd (diff) | |
| download | rust-eb836dd61ed2d780ca9639f73876c3d3e05ef079.tar.gz rust-eb836dd61ed2d780ca9639f73876c3d3e05ef079.zip | |
Settle on the format/write/print family of names
Diffstat (limited to 'src/libsyntax/ext/expand.rs')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 17 | 
1 files changed, 17 insertions, 0 deletions
| diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 4bea1dc23e7..49b8c994dc2 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -940,6 +940,7 @@ pub fn std_macros() -> @str { ); ) + // NOTE(acrichto): start removing this after the next snapshot macro_rules! printf ( ($arg:expr) => ( print(fmt!(\"%?\", $arg)) @@ -949,6 +950,7 @@ pub fn std_macros() -> @str { ) ) + // NOTE(acrichto): start removing this after the next snapshot macro_rules! printfln ( ($arg:expr) => ( println(fmt!(\"%?\", $arg)) @@ -958,6 +960,21 @@ pub fn std_macros() -> @str { ) ) + // 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:expr) => ( ::std::io::print(format!(\"{}\", $arg))); + ($fmt:expr, $($arg:tt)+) => ( ::std::io::print(format!($fmt, $($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)*) => ({ print!($($arg)*); ::std::io::println(\"\"); }) + ) + // NOTE: use this after a snapshot lands to abstract the details // of the TLS interface. macro_rules! local_data_key ( | 
