Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5cd1b5d

Browse files
committed
Add test for use of $crate in nested foreign macro_rules!
1 parent 0caebfa commit 5cd1b5d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pub const IN_DEF_CRATE: &str = "In def crate!";
2+
3+
macro_rules! make_it {
4+
() => {
5+
#[macro_export]
6+
macro_rules! inner {
7+
() => {
8+
$crate::IN_DEF_CRATE
9+
}
10+
}
11+
}
12+
}
13+
14+
make_it!();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// aux-build:nested-dollar-crate.rs
2+
// edition:2018
3+
// run-pass
4+
5+
extern crate nested_dollar_crate;
6+
7+
fn main() {
8+
assert_eq!(nested_dollar_crate::inner!(), "In def crate!");
9+
}

0 commit comments

Comments
 (0)