From 5322cd830eba39c66650a995af7006c2ef16f925 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 21 Mar 2021 01:45:24 +0100 Subject: Expand legacy-scoped macro during collection --- crates/hir_def/src/nameres/tests/macros.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'crates/hir_def/src/nameres/tests') 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 @@ -712,6 +712,27 @@ b! { static = #[] ();} ); } +#[test] +fn macros_defining_macros() { + check( + r#" +macro_rules! item { + ($item:item) => { $item } +} + +item! { + macro_rules! indirect_macro { () => { struct S {} } } +} + +indirect_macro!(); + "#, + expect![[r#" + crate + S: t + "#]], + ); +} + #[test] fn resolves_proc_macros() { check( -- cgit v1.2.3