aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/module/nameres
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-27 17:07:21 +0000
committerAleksey Kladov <[email protected]>2018-12-27 17:07:21 +0000
commitd963042ca9da93be8d5922ce46ea26dc6a79c929 (patch)
tree76f7bfc934dda4e9dfc956fc86fe73379d86a332 /crates/ra_hir/src/module/nameres
parent3b820bcca3a66660d0c5960f2a5c8f765095333e (diff)
introduce hir::Name
Diffstat (limited to 'crates/ra_hir/src/module/nameres')
-rw-r--r--crates/ra_hir/src/module/nameres/tests.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_hir/src/module/nameres/tests.rs b/crates/ra_hir/src/module/nameres/tests.rs
index 03ea5c1d6..165ac81c8 100644
--- a/crates/ra_hir/src/module/nameres/tests.rs
+++ b/crates/ra_hir/src/module/nameres/tests.rs
@@ -9,6 +9,7 @@ use crate::{
9 self as hir, 9 self as hir,
10 db::HirDatabase, 10 db::HirDatabase,
11 mock::MockDatabase, 11 mock::MockDatabase,
12 Name,
12}; 13};
13 14
14fn item_map(fixture: &str) -> (Arc<hir::ItemMap>, hir::ModuleId) { 15fn item_map(fixture: &str) -> (Arc<hir::ItemMap>, hir::ModuleId) {
@@ -38,7 +39,7 @@ fn item_map_smoke_test() {
38 pub struct Baz; 39 pub struct Baz;
39 ", 40 ",
40 ); 41 );
41 let name = SmolStr::from("Baz"); 42 let name = Name::new(SmolStr::from("Baz"));
42 let resolution = &item_map.per_module[&module_id].items[&name]; 43 let resolution = &item_map.per_module[&module_id].items[&name];
43 assert!(resolution.def_id.take_types().is_some()); 44 assert!(resolution.def_id.take_types().is_some());
44} 45}
@@ -57,7 +58,7 @@ fn test_self() {
57 pub struct Baz; 58 pub struct Baz;
58 ", 59 ",
59 ); 60 );
60 let name = SmolStr::from("Baz"); 61 let name = Name::new(SmolStr::from("Baz"));
61 let resolution = &item_map.per_module[&module_id].items[&name]; 62 let resolution = &item_map.per_module[&module_id].items[&name];
62 assert!(resolution.def_id.take_types().is_some()); 63 assert!(resolution.def_id.take_types().is_some());
63} 64}
@@ -90,7 +91,7 @@ fn item_map_across_crates() {
90 let module_id = module.module_id; 91 let module_id = module.module_id;
91 let item_map = db.item_map(source_root).unwrap(); 92 let item_map = db.item_map(source_root).unwrap();
92 93
93 let name = SmolStr::from("Baz"); 94 let name = Name::new(SmolStr::from("Baz"));
94 let resolution = &item_map.per_module[&module_id].items[&name]; 95 let resolution = &item_map.per_module[&module_id].items[&name];
95 assert!(resolution.def_id.take_types().is_some()); 96 assert!(resolution.def_id.take_types().is_some());
96} 97}