]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/macro-backtrace-println.rs
Rollup merge of #106889 - scottmcm:windows-mut, r=cuviper
[rust.git] / tests / ui / macros / macro-backtrace-println.rs
1 // The `format_args!` syntax extension issues errors before code expansion
2 // has completed, but we still need a backtrace.
3
4 // This test includes stripped-down versions of `print!` and `println!`,
5 // because we can't otherwise verify the lines of the backtrace.
6
7 fn print(_args: std::fmt::Arguments) {}
8
9 macro_rules! myprint {
10     ($($arg:tt)*) => (print(format_args!($($arg)*)));
11 }
12
13 macro_rules! myprintln {
14     ($fmt:expr) => (myprint!(concat!($fmt, "\n"))); //~ ERROR no arguments were given
15 }
16
17 fn main() {
18     myprintln!("{}");
19 }