2015-04-03 21:58:41 -05:00
|
|
|
// The `format_args!` syntax extension issues errors before code expansion
|
|
|
|
// has completed, but we still need a backtrace.
|
|
|
|
|
|
|
|
// This test includes stripped-down versions of `print!` and `println!`,
|
|
|
|
// because we can't otherwise verify the lines of the backtrace.
|
|
|
|
|
|
|
|
fn print(_args: std::fmt::Arguments) {}
|
|
|
|
|
2015-09-10 15:25:28 -05:00
|
|
|
macro_rules! myprint {
|
2016-08-17 09:20:04 -05:00
|
|
|
($($arg:tt)*) => (print(format_args!($($arg)*)));
|
2015-04-03 21:58:41 -05:00
|
|
|
}
|
|
|
|
|
2015-09-10 15:25:28 -05:00
|
|
|
macro_rules! myprintln {
|
2017-11-20 06:13:27 -06:00
|
|
|
($fmt:expr) => (myprint!(concat!($fmt, "\n"))); //~ ERROR no arguments were given
|
2015-04-03 21:58:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2016-08-17 09:20:04 -05:00
|
|
|
myprintln!("{}");
|
2015-04-03 21:58:41 -05:00
|
|
|
}
|