summaryrefslogtreecommitdiffstats
path: root/tests/ui/infinite/issue-41731-infinite-macro-print.rs
blob: d52e6e7e9eb8250d08f05ee544d9efa72c8fd8a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// compile-flags: -Z trace-macros

#![recursion_limit = "5"]

fn main() {
    macro_rules! stack {
        ($overflow:expr) => {
            print!(stack!($overflow));
            //~^ ERROR recursion limit reached while expanding
            //~| ERROR format argument must be a string literal
        };
    }

    stack!("overflow");
}