Add test for use of $crate in nested foreign macro_rules!

This commit is contained in:
Aaron Hill 2020-07-14 23:21:59 -04:00
parent 0caebfabe6
commit 5cd1b5dd79
No known key found for this signature in database
GPG key ID: B4087E510E98B164
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,14 @@
pub const IN_DEF_CRATE: &str = "In def crate!";
macro_rules! make_it {
() => {
#[macro_export]
macro_rules! inner {
() => {
$crate::IN_DEF_CRATE
}
}
}
}
make_it!();

View file

@ -0,0 +1,9 @@
// aux-build:nested-dollar-crate.rs
// edition:2018
// run-pass
extern crate nested_dollar_crate;
fn main() {
assert_eq!(nested_dollar_crate::inner!(), "In def crate!");
}