aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-08 12:02:06 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-08 12:02:06 +0000
commit3bb1cb7017aab6fddb38eae3ca671ecbdaedb4da (patch)
tree3c4fb2c638eda0eabcbe93fbf74f411fd14a964b /crates/ra_hir/src/nameres
parentd70ccebcf12253d4028fba6e4717c87ca1c397cd (diff)
parentdc186c0fcca5155a4b11aeb8b48ebcf68ef9c82c (diff)
Merge #455
455: Import fixpoint loop for name resolution r=matklad a=flodiebold This implements reexports, so only the glob import part of #231 remains. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/tests.rs31
1 files changed, 30 insertions, 1 deletions
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs
index dcbe65aec..04faec4fb 100644
--- a/crates/ra_hir/src/nameres/tests.rs
+++ b/crates/ra_hir/src/nameres/tests.rs
@@ -35,7 +35,7 @@ fn check_module_item_map(map: &hir::ItemMap, module_id: hir::ModuleId, expected:
35 .map(|it| it.trim()) 35 .map(|it| it.trim())
36 .collect::<Vec<_>>() 36 .collect::<Vec<_>>()
37 .join("\n"); 37 .join("\n");
38 assert_eq_text!(&actual, &expected); 38 assert_eq_text!(&expected, &actual);
39 39
40 fn dump_resolution(resolution: &hir::Resolution) -> &'static str { 40 fn dump_resolution(resolution: &hir::Resolution) -> &'static str {
41 match ( 41 match (
@@ -78,6 +78,35 @@ fn item_map_smoke_test() {
78} 78}
79 79
80#[test] 80#[test]
81fn re_exports() {
82 let (item_map, module_id) = item_map(
83 "
84 //- /lib.rs
85 mod foo;
86
87 use self::foo::Baz;
88 <|>
89
90 //- /foo/mod.rs
91 pub mod bar;
92
93 pub use self::bar::Baz;
94
95 //- /foo/bar.rs
96 pub struct Baz;
97 ",
98 );
99 check_module_item_map(
100 &item_map,
101 module_id,
102 "
103 Baz: t v
104 foo: t
105 ",
106 );
107}
108
109#[test]
81fn item_map_contains_items_from_expansions() { 110fn item_map_contains_items_from_expansions() {
82 let (item_map, module_id) = item_map( 111 let (item_map, module_id) = item_map(
83 " 112 "