aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/body/tests
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-02-02 14:55:33 +0000
committerJonas Schievink <[email protected]>2021-02-03 14:33:25 +0000
commit63744fe128193464eb0ce63fbe6c30c4f98b6135 (patch)
treeb2a58177c28030dba6389afac69e2e9062ac1afd /crates/hir_def/src/body/tests
parentda57f5dc17303cfd5ba318d1735c7f325f6b7130 (diff)
Test for name resolution with DefMap shortcut
Diffstat (limited to 'crates/hir_def/src/body/tests')
-rw-r--r--crates/hir_def/src/body/tests/block.rs33
1 files changed, 33 insertions, 0 deletions
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 {
185 "#]], 185 "#]],
186 ); 186 );
187} 187}
188
189#[test]
190fn macro_resolve_legacy() {
191 check_at(
192 r#"
193//- /lib.rs
194mod module;
195
196//- /module.rs
197macro_rules! m {
198 () => {
199 struct Def {}
200 };
201}
202
203fn f() {
204 {
205 m!();
206 $0
207 }
208}
209 "#,
210 expect![[r#"
211 block scope
212 Def: t
213 crate
214 module: t
215
216 crate::module
217 f: v
218 "#]],
219 )
220}