auto merge of #7779 : kballard/rust/print-macro-args, r=alexcrichton

The new names make it obvious that these generate formatted output.

Add a one-argument case that uses %? to format, just like the other
format-using macros (e.g. info!()).
This commit is contained in:
bors 2013-07-14 04:13:24 -07:00
commit 51cb98443c

View file

@ -644,16 +644,22 @@ pub fn core_macros() -> @str {
); );
) )
macro_rules! print( macro_rules! printf (
($( $arg:expr),+) => ( { ($arg:expr) => (
print(fmt!($($arg),+)); print(fmt!(\"%?\", $arg))
} ) );
($( $arg:expr ),+) => (
print(fmt!($($arg),+))
)
) )
macro_rules! println( macro_rules! printfln (
($( $arg:expr),+) => ( { ($arg:expr) => (
println(fmt!($($arg),+)); println(fmt!(\"%?\", $arg))
} ) );
($( $arg:expr ),+) => (
println(fmt!($($arg),+))
)
) )
}"; }";
} }