From 63744fe128193464eb0ce63fbe6c30c4f98b6135 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 2 Feb 2021 15:55:33 +0100 Subject: Test for name resolution with DefMap shortcut --- crates/hir_def/src/body/tests/block.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'crates') diff --git a/crates/hir_def/src/body/tests/block.rs b/crates/hir_def/src/body/tests/block.rs index 6b1ed2555..d5f3ac4c5 100644 --- a/crates/hir_def/src/body/tests/block.rs +++ b/crates/hir_def/src/body/tests/block.rs @@ -185,3 +185,36 @@ pub mod mark { "#]], ); } + +#[test] +fn macro_resolve_legacy() { + check_at( + r#" +//- /lib.rs +mod module; + +//- /module.rs +macro_rules! m { + () => { + struct Def {} + }; +} + +fn f() { + { + m!(); + $0 + } +} + "#, + expect![[r#" + block scope + Def: t + crate + module: t + + crate::module + f: v + "#]], + ) +} -- cgit v1.2.3