2020-06-24 12:16:36 -05:00
|
|
|
// aux-build:make-macro.rs
|
|
|
|
// aux-build:meta-macro.rs
|
|
|
|
// edition:2018
|
2020-07-26 19:00:35 -05:00
|
|
|
// compile-flags: -Z span-debug -Z macro-backtrace
|
2020-06-24 12:16:36 -05:00
|
|
|
// check-pass
|
2020-07-26 19:00:35 -05:00
|
|
|
// normalize-stdout-test "#\d+" -> "#CTXT"
|
2020-06-29 21:02:57 -05:00
|
|
|
// normalize-stdout-test "\d+#" -> "0#"
|
2020-07-21 18:51:07 -05:00
|
|
|
//
|
|
|
|
// We don't care about symbol ids, so we set them all to 0
|
2020-06-29 21:02:57 -05:00
|
|
|
// in the stdout
|
2020-06-24 12:16:36 -05:00
|
|
|
extern crate meta_macro;
|
2020-07-21 18:51:07 -05:00
|
|
|
|
|
|
|
macro_rules! produce_it {
|
|
|
|
() => {
|
|
|
|
// `print_def_site!` will respan the `$crate` identifier
|
|
|
|
// with `Span::def_site()`. This should cause it to resolve
|
|
|
|
// relative to `meta_macro`, *not* `make_macro` (despite
|
|
|
|
// the fact that that `print_def_site` is produced by
|
|
|
|
// a `macro_rules!` macro in `make_macro`).
|
|
|
|
meta_macro::print_def_site!($crate::dummy!());
|
|
|
|
}
|
|
|
|
}
|
2020-06-24 12:16:36 -05:00
|
|
|
|
|
|
|
fn main() {
|
2020-07-21 18:51:07 -05:00
|
|
|
produce_it!();
|
2020-06-24 12:16:36 -05:00
|
|
|
}
|