diff --git a/src/test/ui/hygiene/auxiliary/nested-dollar-crate.rs b/src/test/ui/hygiene/auxiliary/nested-dollar-crate.rs new file mode 100644 index 00000000000..e5caa0f9cf8 --- /dev/null +++ b/src/test/ui/hygiene/auxiliary/nested-dollar-crate.rs @@ -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!(); diff --git a/src/test/ui/hygiene/nested-dollar-crate.rs b/src/test/ui/hygiene/nested-dollar-crate.rs new file mode 100644 index 00000000000..e8703bc77ee --- /dev/null +++ b/src/test/ui/hygiene/nested-dollar-crate.rs @@ -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!"); +}