Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/body/tests/block.rs')
-rw-r--r--crates/hir-def/src/body/tests/block.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/crates/hir-def/src/body/tests/block.rs b/crates/hir-def/src/body/tests/block.rs
index 44eeed9e3f..985c6387ba 100644
--- a/crates/hir-def/src/body/tests/block.rs
+++ b/crates/hir-def/src/body/tests/block.rs
@@ -299,6 +299,40 @@ pub mod cov_mark {
}
#[test]
+fn macro_exported_in_block_mod() {
+ check_at(
+ r#"
+#[macro_export]
+macro_rules! foo {
+ () => { pub struct FooWorks; };
+}
+macro_rules! bar {
+ () => { pub struct BarWorks; };
+}
+fn main() {
+ mod module {
+ foo!();
+ bar!();
+ $0
+ }
+}
+"#,
+ expect![[r#"
+ block scope
+ module: t
+
+ block scope::module
+ BarWorks: t v
+ FooWorks: t v
+
+ crate
+ foo: m
+ main: v
+ "#]],
+ );
+}
+
+#[test]
fn macro_resolve_legacy() {
check_at(
r#"