aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/tests
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-03-21 00:45:24 +0000
committerJonas Schievink <[email protected]>2021-03-21 00:45:24 +0000
commit5322cd830eba39c66650a995af7006c2ef16f925 (patch)
treea31747f6c05faf9f393358560ca859f519a7db84 /crates/hir_def/src/nameres/tests
parent787bd3c5516d250245f6070308d689311b638fbe (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.rs21
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]
716fn macros_defining_macros() {
717 check(
718 r#"
719macro_rules! item {
720 ($item:item) => { $item }
721}
722
723item! {
724 macro_rules! indirect_macro { () => { struct S {} } }
725}
726
727indirect_macro!();
728 "#,
729 expect![[r#"
730 crate
731 S: t
732 "#]],
733 );
734}
735
736#[test]
716fn resolves_proc_macros() { 737fn resolves_proc_macros() {
717 check( 738 check(
718 r" 739 r"