From 33d5793f1983f14a7696e967ff9d4c54b572d9fd Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 1 Jul 2021 17:28:42 +0200 Subject: [PATCH] Add a simpler legacy macro scoping test --- crates/hir_def/src/nameres/tests/macros.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/hir_def/src/nameres/tests/macros.rs b/crates/hir_def/src/nameres/tests/macros.rs index 37161843864..c2f68b7d543 100644 --- a/crates/hir_def/src/nameres/tests/macros.rs +++ b/crates/hir_def/src/nameres/tests/macros.rs @@ -335,6 +335,24 @@ macro_rules! declare_mod { ); } +#[test] +fn legacy_macro_use_before_def() { + check( + r#" +m!(); + +macro_rules! m { + () => { + struct S; + } +} +"#, + expect![[r#" + crate + "#]], + ); +} + #[test] fn plain_macros_are_legacy_textual_scoped() { check(