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 @@ mod prelude { ); } +#[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(