mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
Add test for use of $crate in nested foreign macro_rules!
This commit is contained in:
@@ -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!();
|
||||
@@ -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!");
|
||||
}
|
||||
Reference in New Issue
Block a user