]>
Commit | Line | Data |
---|---|---|
f035d41b XL |
1 | // aux-build:make-macro.rs |
2 | // aux-build:meta-macro.rs | |
3 | // edition:2018 | |
1b1a35ee | 4 | // compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene -Z trim-diagnostic-paths=no |
f035d41b XL |
5 | // check-pass |
6 | // normalize-stdout-test "\d+#" -> "0#" | |
c295e0f8 | 7 | // normalize-stdout-test "expn\d{3,}" -> "expnNNN" |
3dfed10e XL |
8 | // |
9 | // We don't care about symbol ids, so we set them all to 0 | |
f035d41b | 10 | // in the stdout |
3dfed10e XL |
11 | |
12 | #![no_std] // Don't load unnecessary hygiene information from std | |
13 | extern crate std; | |
14 | ||
f035d41b XL |
15 | extern crate meta_macro; |
16 | ||
3dfed10e XL |
17 | macro_rules! produce_it { |
18 | () => { | |
19 | // `print_def_site!` will respan the `$crate` identifier | |
20 | // with `Span::def_site()`. This should cause it to resolve | |
21 | // relative to `meta_macro`, *not* `make_macro` (despite | |
2b03887a FG |
22 | // the fact that `print_def_site` is produced by a |
23 | // `macro_rules!` macro in `make_macro`). | |
3dfed10e XL |
24 | meta_macro::print_def_site!($crate::dummy!()); |
25 | } | |
26 | } | |
27 | ||
f035d41b | 28 | fn main() { |
3dfed10e | 29 | produce_it!(); |
f035d41b | 30 | } |