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