diff options
author | Jonas Schievink <[email protected]> | 2021-03-21 00:45:24 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-03-21 00:45:24 +0000 |
commit | 5322cd830eba39c66650a995af7006c2ef16f925 (patch) | |
tree | a31747f6c05faf9f393358560ca859f519a7db84 /crates/hir_def/src/nameres/tests | |
parent | 787bd3c5516d250245f6070308d689311b638fbe (diff) |
Expand legacy-scoped macro during collection
Diffstat (limited to 'crates/hir_def/src/nameres/tests')
-rw-r--r-- | crates/hir_def/src/nameres/tests/macros.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres/tests/macros.rs b/crates/hir_def/src/nameres/tests/macros.rs index d59d3c0db..6d3cb8d7a 100644 --- a/crates/hir_def/src/nameres/tests/macros.rs +++ b/crates/hir_def/src/nameres/tests/macros.rs | |||
@@ -713,6 +713,27 @@ b! { static = #[] ();} | |||
713 | } | 713 | } |
714 | 714 | ||
715 | #[test] | 715 | #[test] |
716 | fn macros_defining_macros() { | ||
717 | check( | ||
718 | r#" | ||
719 | macro_rules! item { | ||
720 | ($item:item) => { $item } | ||
721 | } | ||
722 | |||
723 | item! { | ||
724 | macro_rules! indirect_macro { () => { struct S {} } } | ||
725 | } | ||
726 | |||
727 | indirect_macro!(); | ||
728 | "#, | ||
729 | expect![[r#" | ||
730 | crate | ||
731 | S: t | ||
732 | "#]], | ||
733 | ); | ||
734 | } | ||
735 | |||
736 | #[test] | ||
716 | fn resolves_proc_macros() { | 737 | fn resolves_proc_macros() { |
717 | check( | 738 | check( |
718 | r" | 739 | r" |