]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/macro-backtrace-nested.rs
Rollup merge of #105796 - notriddle:notriddle/rustdoc-search-stop-doing-demerits...
[rust.git] / tests / ui / macros / macro-backtrace-nested.rs
1 // In expression position, but not statement position, when we expand a macro,
2 // we replace the span of the expanded expression with that of the call site.
3
4 macro_rules! nested_expr {
5     () => (fake) //~ ERROR cannot find
6     //~^ ERROR cannot find
7 }
8
9 macro_rules! call_nested_expr {
10     () => (nested_expr!())
11 }
12
13 macro_rules! call_nested_expr_sum {
14     () => { 1 + nested_expr!(); }
15 }
16
17 fn main() {
18     1 + call_nested_expr!();
19     call_nested_expr_sum!();
20 }