Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/expand_macro.rs')
| -rw-r--r-- | crates/ide/src/expand_macro.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/crates/ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs index d36670e983..fd0a29f64f 100644 --- a/crates/ide/src/expand_macro.rs +++ b/crates/ide/src/expand_macro.rs @@ -361,6 +361,38 @@ fn main() { } #[test] + fn macro_expand_inner_macro_rules() { + check( + r#" +macro_rules! foo { + ($t:tt) => {{ + macro_rules! bar { + () => { + $t + } + } + bar!() + }}; +} + +fn main() { + foo$0!(42); +} + "#, + expect![[r#" + foo + { + macro_rules! bar { + () => { + 42 + } + } + 42 + }"#]], + ); + } + + #[test] fn macro_expand_inner_macro_fail_to_expand() { check( r#" |