diff options
Diffstat (limited to 'crates/ra_hir/src/module/nameres')
-rw-r--r-- | crates/ra_hir/src/module/nameres/tests.rs | 7 |
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 9ddc32dcd..9fa9146e3 100644 --- a/crates/ra_hir/src/module/nameres/tests.rs +++ b/crates/ra_hir/src/module/nameres/tests.rs | |||
@@ -3,6 +3,7 @@ use std::sync::Arc; | |||
3 | use salsa::Database; | 3 | use salsa::Database; |
4 | use ra_db::{FilesDatabase, CrateGraph}; | 4 | use ra_db::{FilesDatabase, CrateGraph}; |
5 | use ra_syntax::SmolStr; | 5 | use ra_syntax::SmolStr; |
6 | use relative_path::RelativePath; | ||
6 | 7 | ||
7 | use crate::{ | 8 | use crate::{ |
8 | self as hir, | 9 | self as hir, |
@@ -44,7 +45,7 @@ fn item_map_smoke_test() { | |||
44 | 45 | ||
45 | #[test] | 46 | #[test] |
46 | fn item_map_across_crates() { | 47 | fn item_map_across_crates() { |
47 | let (mut db, files) = MockDatabase::with_files( | 48 | let (mut db, sr) = MockDatabase::with_files( |
48 | " | 49 | " |
49 | //- /main.rs | 50 | //- /main.rs |
50 | use test_crate::Baz; | 51 | use test_crate::Baz; |
@@ -53,8 +54,8 @@ fn item_map_across_crates() { | |||
53 | pub struct Baz; | 54 | pub struct Baz; |
54 | ", | 55 | ", |
55 | ); | 56 | ); |
56 | let main_id = files.file_id("/main.rs"); | 57 | let main_id = sr.files[RelativePath::new("/main.rs")]; |
57 | let lib_id = files.file_id("/lib.rs"); | 58 | let lib_id = sr.files[RelativePath::new("/lib.rs")]; |
58 | 59 | ||
59 | let mut crate_graph = CrateGraph::default(); | 60 | let mut crate_graph = CrateGraph::default(); |
60 | let main_crate = crate_graph.add_crate_root(main_id); | 61 | let main_crate = crate_graph.add_crate_root(main_id); |