]> git.proxmox.com Git - rustc.git/blame - src/test/ui/proc-macro/meta-macro-hygiene.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / proc-macro / meta-macro-hygiene.rs
CommitLineData
1b1a35ee 1// ignore-tidy-linelength
f035d41b
XL
2// aux-build:make-macro.rs
3// aux-build:meta-macro.rs
4// edition:2018
1b1a35ee 5// compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene -Z trim-diagnostic-paths=no
f035d41b
XL
6// check-pass
7// normalize-stdout-test "\d+#" -> "0#"
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
13extern crate std;
14
f035d41b
XL
15extern crate meta_macro;
16
3dfed10e
XL
17macro_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
22 // the fact that that `print_def_site` is produced by
23 // a `macro_rules!` macro in `make_macro`).
24 meta_macro::print_def_site!($crate::dummy!());
25 }
26}
27
f035d41b 28fn main() {
3dfed10e 29 produce_it!();
f035d41b 30}