aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-01-21 15:23:50 +0000
committerJonas Schievink <[email protected]>2021-01-21 15:23:50 +0000
commitec4a1dc297eb90dde4c22c682a35606aaa50b4d4 (patch)
treecc5de8de27a1d665e14ebe874b4bb42f605379f8 /crates/hir_def/src/nameres
parentd62c9c6c6305cbba31069457e33c9d4c6a4b40d6 (diff)
Add test that merges inner and outer names
Diffstat (limited to 'crates/hir_def/src/nameres')
-rw-r--r--crates/hir_def/src/nameres/tests/block.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres/tests/block.rs b/crates/hir_def/src/nameres/tests/block.rs
index 996704308..ab7ec9d62 100644
--- a/crates/hir_def/src/nameres/tests/block.rs
+++ b/crates/hir_def/src/nameres/tests/block.rs
@@ -45,3 +45,28 @@ fn outer() {
45 "#]], 45 "#]],
46 ); 46 );
47} 47}
48
49#[test]
50fn merge_namespaces() {
51 check_at(
52 r#"
53//- /lib.rs
54struct name {}
55fn outer() {
56 fn name() {}
57
58 use name as imported; // should import both `name`s
59
60 $0
61}
62"#,
63 expect![[r#"
64 block scope
65 imported: t v
66 name: v
67 crate
68 name: t
69 outer: v
70 "#]],
71 );
72}